-
Notifications
You must be signed in to change notification settings - Fork 344
FetchOptions has no property uri #189
Comments
The problem is this line |
Any news? |
I'm no longer seeing this issue using |
I still have this problem :/ |
Yeah, I started from a clean |
|
By moving the destructuring out of the parameter into the body of // httpLink.ts
export const createHttpLink = (options?: FetchOptions) => {
let { uri, fetch: fetcher, includeExtensions, ...requestOptions } = options;
// ...
};
// httpLink.d.ts
export declare const createHttpLink: (options?: FetchOptions) => ApolloLink; |
hmmm, I'm happy to merge and release that PR but that should certainly be valid typescript and not show that error. If the changes work though I'm happy with it! |
* Fix typescript destructuring error, #189 * Update changelog
Thank you for the fix! |
Intended outcome:
No compilation errors.
Actual outcome:
Get a TS error
TS2459: Type 'FetchOptions | undefined' has no property 'uri' and no string index signature
when compiling a simple CRA app.How to reproduce the issue:
Using
[email protected]
, I have the following code to create anApolloClient
:It's very strange and I don't see anything obviously wrong with the declaration file (
/path/to/node_modules/apollo-link-http/lib/httpLink.d.ts
) that would cause this. What makes it more odd is that it seems to only happen the first time it's compiled, but if I make a change that forces a recompilation it will typically build without a problem. I'm wondering if anyone else has seen this before or could think of what might be causing it.The text was updated successfully, but these errors were encountered: