Typescript errors on fresh install
See original GitHub issueIntended outcome:
Installing should not produce any errors in typescript.
Actual outcome:
Typescript produced the following errors, immediately after installing apollo-client:
node_modules/@types/isomorphic-fetch/index.d.ts(8,30): error TS2304: Cannot find name 'fetch'.
node_modules/apollo-client/transport/afterware.d.ts(4,15): error TS2304: Cannot find name 'Response'.
node_modules/apollo-client/transport/afterware.d.ts(5,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/afterware.d.ts(11,16): error TS2304: Cannot find name 'Response'.
node_modules/apollo-client/transport/afterware.d.ts(12,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/batchedNetworkInterface.d.ts(8,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/batchedNetworkInterface.d.ts(11,16): error TS2304: Cannot find name 'Response'.
node_modules/apollo-client/transport/batchedNetworkInterface.d.ts(12,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/batchedNetworkInterface.d.ts(18,64): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/batchedNetworkInterface.d.ts(30,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/middleware.d.ts(5,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/middleware.d.ts(12,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(31,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(39,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(42,15): error TS2304: Cannot find name 'Response'.
node_modules/apollo-client/transport/networkInterface.d.ts(43,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(50,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(51,49): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/transport/networkInterface.d.ts(59,77): error TS2304: Cannot find name 'Response'.
node_modules/apollo-client/transport/networkInterface.d.ts(66,12): error TS2304: Cannot find name 'RequestInit'.
How to reproduce the issue:
- Clone: https://github.com/ForbesLindesay/apollo-client-typescript-error
- Run
npm run build
- Observe that there are typescript errors, and that they’re all from apollo.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Typescript Errors after install - Microsoft Community Hub
Hello, I cannot practice TypeScript because I get these errors every time when I run a ts file: I have latest VS Code...
Read more >Why and how VSCode fresh install thinks it has TypeScript?
VS Code ships with a recent stable version of the TypeScript language service and it may not match the version of TypeScript installed...
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >TS Playground - An online editor for exploring TypeScript and ...
Check for class properties that are declared but not set in the constructor. ... Enable error reporting when this is given the type...
Read more >[VS 2022] Javascript Content Files Project errors when using ...
Run dotnet new angular · Run npx @angular/cli@13 update @angular/core@13 @angular/cli@13 to update to angular 13 and typescript 4.4.4 · Notice errors from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You have two options:
a) add
dom
to tsconfig.json >compilerOptions.lib
b) install typings that containsfetch
,Response
andRequestInit
First option is recommended 👍
@helfer Just so you know about it, this could be a popular topic in github issues 😃
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client!