apollo-angular/types.d.ts error TS2312 on a new Angular 14 app
See original GitHub issueDescribe the bug
After creating a new Angular app using ng new and adding apollo-angular using ng add, the build fails. No other changes were made to the project.
To Reproduce Steps to reproduce the behavior: Create a new Angular app using ng new app-name Add apollo-angular to the app using ng add apollo-angular Serve the application using ng serve
Get the following error:
Error: node_modules/apollo-angular/types.d.ts:11:54 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.
11 export interface MutationResult<TData = any> extends FetchResult<TData> {
Expected behavior
The app should compile normally
Environment:
├── @angular/cli@14.2.4 ├── @angular/core@14.2.4 ├── @apollo/client@3.7.0 ├── apollo-angular@4.0.1 ├── graphql@15.8.0 └── typescript@4.7.4
Additional context
Node: 16.13.2 Package Manager: npm 8.1.2 OS: win32 x64
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:13 (1 by maintainers)
Top Results From Across the Web
how can I install apollo-angular on angular 14? - Stack Overflow
Error: node_modules/apollo-angular/types.d.ts:11:54 - error TS2312: An interface can only extend an object type or intersection of object ...
Read more >Breaking change with @defer changes and apollo angular ...
Intended outcome: My angular project utilizing @graphql-codegen, ... apollo-angular/types.d.ts error TS2312 on a new Angular 14 app ...
Read more >TypeScript configuration - Angular
TypeScript is a primary language for Angular application development. It is a superset of JavaScript with design-time support for type safety and tooling....
Read more >How to Setup Apollo Graphql Client with Angular
Instructions on setting up Apollo GraphQL Client with Angular App ... @types/graphql if it exists or add a new declaration (.d.ts) file ...
Read more >Angular TypeScript Tutorial in Visual Studio Code
You can now create a new Angular application by typing: ... ATA pulls down the npm Type Declaration files ( *.d.ts ) for...
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
I ran into the same issue when updating @apollo/client from 3.6.9 to 3.7.0. I reverted back to 3.6.9
Hi @groznikg, I use @damilgra 's workaround. In your package.json, instead of
"@apollo/client": "^3.6.9",
delete the circumflex^ to force npm to use the working version 3.6.9:"@apollo/client": "3.6.9",
And wait until it is fixed 😃