question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

apollo-angular/types.d.ts error TS2312 on a new Angular 14 app

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Reactions:4
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
damilgracommented, Oct 1, 2022

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

9reactions
de-dancommented, Oct 4, 2022

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found