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/client@3.4.10` produces `error TS2688: Cannot find type definition for 'zen-observable'`

See original GitHub issue

Intended outcome: Upgrading application from @apollo/client@3.4.9 to 3.4.10should work without error.

Actual outcome: Building or linting application produces:

Error: node_modules/@apollo/client/core/ApolloClient.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/core/ObservableQuery.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/core/QueryInfo.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/core/QueryInfo.d.ts:22:24 - error TS2503: Cannot find namespace 'ZenObservable'.

22     subscriptions: Set<ZenObservable.Subscription>;
                          ~~~~~~~~~~~~~


Error: node_modules/@apollo/client/core/QueryManager.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/core/ApolloLink.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/core/ApolloLink.d.ts:14:46 - error TS2503: Cannot find namespace 'ZenObservable'.

14     protected onError(error: any, observer?: ZenObservable.Observer<FetchResult>): false | void;
                                                ~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/core/types.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/error/index.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/retry/retryLink.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/utils/fromError.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/utils/fromPromise.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/utils/toPromise.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/link/ws/index.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/utilities/observables/Concast.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/utilities/observables/asyncMap.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~


Error: node_modules/@apollo/client/utilities/observables/subclassing.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
                        ~~~~~~~~~~~~~~

How to reproduce the issue: tsc on project including @apollo/client@3.4.10

Versions

  System:
    OS: macOS 11.5
  Binaries:
    Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
    npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm
  Browsers:
    Chrome: 92.0.4515.159
    Firefox: 91.0
    Safari: 14.1.2
  npmPackages:
    @apollo/client: 3.4.10 => 3.4.10
    apollo-angular: 2.6.0 => 2.6.0 
    apollo-server-core: 3.3.0 => 3.3.0 
    apollo-server-express: 3.3.0 => 3.3.0 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KeithGillettecommented, Aug 30, 2021

@benjamn: Are you saying I need to make zen-observable-ts a dependency of our project to eliminate this transpilation error? We’ve never included it as a dependency with prior versions of @apollo/client.

0reactions
benjamncommented, Aug 30, 2021

Right, no need to start depending on zen-observable-ts! A better recommendation would have been to delete node_modules/zen-observable-ts and then rerun npm i. Sorry for any confusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find type definition file for 'zen-observable
I'm working with Ionic 3, I just choose aws default template and I get an error:
Read more >
ObservableQuery - Apollo GraphQL Docs
The single Error object that is passed to onError and useQuery hooks, and is often thrown during manual client.query calls. This will contain...
Read more >
Getting error for types that I have installed but dont use when I ...
Run npx tsc and look at the errors you get : node_modules/@jest/environment/build/index.d.ts:8:23 - error TS2688: Cannot find type definition ...
Read more >
@types/zen-observable - npm
TypeScript definitions for zen-observable. Latest version: 0.8.3, last published: a year ago. Start using @types/zen-observable in your ...
Read more >
Cannot find type definition file for 'zen-observable' - Ionic Forum
This Bug is a starting Bug that must be fixed at the nearest delay. > ionic start app0 aws // aws is a...
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