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.5.0` transpilation produces `error TS2688: Cannot find type definition file for 'zen-observable'.``

See original GitHub issue

Intended outcome: Updating from 3.4.17 to ^3.5.0 should work without error.

Actual outcome: Building a project depending on @apollo/client@3.5.2 generates transpilation error TS2688: Cannot find type definition file for 'zen-observable'. when tsc is run with default skipLibCheck: false:

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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

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

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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" />
                        ~~~~~~~~~~~~~~

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: Run tsc on project including @apollo/client@3.5.2 with tsconfig.json leaving default skipLibCheck: false.

Versions

System:
  OS: macOS 12.0.1
Binaries:
  Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
  npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
Browsers:
  Chrome: 95.0.4638.69
  Firefox: 92.0.1
  Safari: 15.1
npmPackages:
  @apollo/client: 3.5.2 => 3.5.2 
  apollo-angular: 2.6.0 => 2.6.0 
  apollo-server-core: 3.5.0 => 3.5.0 
  apollo-server-express: 3.5.0 => 3.5.0 

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
MaRuifengcommented, May 11, 2022

Has this issue been resolved indeed? I am getting below error message. I know it’s reflected in a different library package apollo-link-timeout, but downgrading “@apollo/client” from 3.6.1 to 3.3.6 fixed the issue. After downgrading I was able to see package @types/zen-observable being installed properly.

node_modules/apollo-link-timeout/lib/timeoutLink.d.ts:1:23 - error TS2688: Cannot find type definition file for 'zen-observable'.

1 /// <reference types="zen-observable" />
1reaction
benjamncommented, Nov 17, 2021

@KeithGillette Thanks for double checking!

While I’m confident @apollo/client@3.5.3 (just published by me) will resolve this issue, I’m less sure about the explanation. I tried reverting the changes in #9073 and rebuilding (and then also rebuilding from v3.5.2), and neither rebuild brought back the <reference types="zen-observable" /> declarations (good, but strange they got published).

Since different people published v3.5.2 and v3.5.0-v3.5.2, it’s possible we (@hwillson @brainkim and I) need to align our publishing workflows better. Good to know.

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 >
Why does the build fail? : r/typescript - Reddit
The error message is a bunch of: error TS2688: Cannot find type definition file for 'aws-lambda'. What is going on here? Why is...
Read more >
zen-observable-ts | Yarn - Package Manager
Thin wrapper around zen-observable and @types/zen-observable , to support ESM exports as well as CommonJS exports, with TypeScript types provided by ...
Read more >
ObservableQuery - Apollo GraphQL Docs
Note: the promise will return null immediately if the query is not active (there are no subscribers). Arguments. Name / Type, Description. variables....
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