Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing ZenObservable module. #2405

Closed
Esemesek opened this issue Oct 26, 2017 · 4 comments
Closed

Missing ZenObservable module. #2405

Esemesek opened this issue Oct 26, 2017 · 4 comments
Labels
📚 good-first-issue Issues that are suitable for first-time contributors.

Comments

@Esemesek
Copy link
Contributor

Esemesek commented Oct 26, 2017

Intended outcome:

I was just trying to upgrade to apollo-client ^2.0.0.

My tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "outDir": "./build/dist",
    "rootDir": "./src",
    "strict": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": true
}

Actual outcome:

$ gulp start
[19:48:46] Using gulpfile ~/projects/loud_cloud/ldc_node/gulpfile.js
[19:48:46] Starting 'graphql-copy'...
[19:48:46] Finished 'graphql-copy' after 20 ms
[19:48:46] Starting 'compile'...
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-client/util/Observable.d.ts(1,23): error TS2688: Cannot find type definition file for 'zen-observable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-client/util/Observable.d.ts(3,36): error TS2503: Cannot find namespace 'ZenObservable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-client/util/Observable.d.ts(4,35): error TS2503: Cannot find namespace 'ZenObservable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link-http/lib/httpLink.d.ts(1,23): error TS2688: Cannot find type definition file for 'zen-observable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/index.d.ts(4,29): error TS7016: Could not find a declaration file for module 'zen-observable'. '/home/kacper/projects/loud_cloud/ldc_node/node_modules/zen-observable/index.js' implicitly has an 'any' type.
  Try `npm install @types/zen-observable` if it exists or add a new declaration (.d.ts) file containing `declare module 'zen-observable';`
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/link.d.ts(1,23): error TS2688: Cannot find type definition file for 'zen-observable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/link.d.ts(2,29): error TS7016: Could not find a declaration file for module 'zen-observable'. '/home/kacper/projects/loud_cloud/ldc_node/node_modules/zen-observable/index.js' implicitly has an 'any' type.
  Try `npm install @types/zen-observable` if it exists or add a new declaration (.d.ts) file containing `declare module 'zen-observable';`
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/linkUtils.d.ts(1,23): error TS2688: Cannot find type definition file for 'zen-observable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/linkUtils.d.ts(2,29): error TS7016: Could not find a declaration file for module 'zen-observable'. '/home/kacper/projects/loud_cloud/ldc_node/node_modules/zen-observable/index.js' implicitly has an 'any' type.
  Try `npm install @types/zen-observable` if it exists or add a new declaration (.d.ts) file containing `declare module 'zen-observable';`
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/types.d.ts(1,23): error TS2688: Cannot find type definition file for 'zen-observable'.
/home/kacper/projects/loud_cloud/ldc_node/node_modules/apollo-link/lib/types.d.ts(2,29): error TS7016: Could not find a declaration file for module 'zen-observable'. '/home/kacper/projects/loud_cloud/ldc_node/node_modules/zen-observable/index.js' implicitly has an 'any' type.
  Try `npm install @types/zen-observable` if it exists or add a new declaration (.d.ts) file containing `declare module 'zen-observable';`
[19:48:49] TypeScript: 11 semantic errors
[19:48:49] TypeScript: emit succeeded (with errors)

How to reproduce the issue:

Version

I can fix it just by adding zen-observable and types/zen-observable, but I don't want to.

@KeithGillette
Copy link
Contributor

I encountered the same issue with [email protected]. I was able to work around it by adding @types/zen-observable to my project.

@sheeldotme
Copy link

This was the solution in apollo-link: apollographql/apollo-link#163

@jbaxleyiii
Copy link
Contributor

@Esemesek @KeithGillette @sheeldotme would any of you be able to open a PR adding these types to the deps instead of dev deps?

@jbaxleyiii jbaxleyiii added the 📚 good-first-issue Issues that are suitable for first-time contributors. label Oct 31, 2017
@Esemesek
Copy link
Contributor Author

Created PR - #2442

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 good-first-issue Issues that are suitable for first-time contributors.
Projects
None yet
Development

No branches or pull requests

4 participants