# Fixed: IHttpClient in 2 beta 11

**URL:** <https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360>\
**Category:** Help Requests\
**Created:** [February 27, 2024, 11:43am UTC](https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360 "2024-02-27T11:43:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aGustafson](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@aGustafson](https://discourse.aurelia.io/u/aGustafson)\
**Post date:** [February 27, 2024, 11:43am UTC](https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360/1 "2024-02-27T11:43:46Z")

</div>

Hi, did something change recently regarding the Fetch Client ?

I am trying to get the IHttpClient setup in a service class, using the example in the documentation. Like this:

```auto
    constructor(@newInstanceOf(IHttpClient) readonly http: IHttpClient) {
        http.configure(config =>
        config
            .withBaseUrl('/api/')
            .withDefaults({
                credentials: 'same-origin',
                headers: {
                    'Accept': 'application/json',
                    'X-Requested-With': 'Fetch'
                }
            })
            .withInterceptor({
                async response(response) {
                    if(response.ok && response.headers.get('Content-Type').startsWith('application/json')) {
                        const data = await response.json();
                        return data
                    }
                    return response;
                }
            }
        ));
    }

```

The browser console is giving me the following error:

Error: AUR0017: Failed to instantiate ‘InterfaceSymbol’ via @newInstanceOf/@newInstanceForScope, there’s no registration and no default implementation.

These are my imports:

```auto
import {IHttpClient} from '@aurelia/fetch-client';
import { newInstanceOf } from '@aurelia/kernel';

```

---

<div class="post-metadata">

**Author:** ![elitastic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitastic/32/1787_2.png) [@elitastic](https://discourse.aurelia.io/u/elitastic)\
**Post date:** [February 27, 2024, 12:19pm UTC](https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360/2 "2024-02-27T12:19:28Z")

</div>

I don’t know the details, but there was a recent fix regarding IHttpClient injection:

> <https://github.com/aurelia/aurelia/issues/1905>
>
> \<!---
> Thanks for filing an issue 😄 ! Before you submit, please read the followi…ng:
> 
> Search open/closed issues before submitting since someone might have asked the same thing before!
> \--\>
> 
> \# 🐛 Bug Report
> 
> 
> 
> As per the discussion here: https://discourse.aurelia.io/t/typescript-to-vanilla-js-for-injecting-ihttpclient/5272/2
> 
> 
> \## 🤔 Expected Behavior
> 
> Should be able to inject a new instance of IHttpClient without getting an error.
> 
> \## 😯 Current Behavior
> 
> \`\`\`
> export class ApiService {
> http = resolve(newInstanceOf(IHttpClient))
> }
> \`\`\`
> 
> \`\`\`
> export class ProductionApiService {
> constructor() {
> this.http = resolve(newInstanceOf(IHttpClient))
> }
> }
> \`\`\`
> 
> \`\`\`
> @inject(newInstanceOf(IHttpClient))
> \`\`\`
> 
> Results in this error:
> 
> \`\`\`
> AUR0017:InterfaceSymbol\<IHttpClient\>
> at createMappedError (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:80:40)
> at createNewInstance (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:1254:15)
> at eval (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:1241:54)
> at Resolver.resolve (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:1174:20)
> at Container.get (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:629:22)
> at Container.containerGetKey (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:871:17)
> at Array.map (\<anonymous\>)
> at Factory.construct (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:843:56)
> at Resolver.resolve (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:1283:57)
> at Container.get (webpack-internal:///./node\_modules/@aurelia/kernel/dist/esm/index.mjs:642:34)
> \`\`\`

---

<div class="post-metadata">

**Author:** ![aGustafson](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@aGustafson](https://discourse.aurelia.io/u/aGustafson)\
**Post date:** [February 27, 2024, 12:52pm UTC](https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360/3 "2024-02-27T12:52:06Z")

</div>

Ahh, looks like something happened.  
I tried beta 10 and it works as documented. Maybe I’ll hang tight until beta 12.  
Thanks!

---

<div class="post-metadata">

**Author:** ![aGustafson](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@aGustafson](https://discourse.aurelia.io/u/aGustafson)\
**Post date:** [March 11, 2024, 4:24pm UTC](https://discourse.aurelia.io/t/fixed-ihttpclient-in-2-beta-11/5360/4 "2024-03-11T16:24:53Z")

</div>

beta 12 fixed this. Thanks!
