nodejs-pubsub: Can't use the library in projects that build with skipLibCheck: false

Environment details

  • OS: Linux
  • Node.js version: 10.15.1
  • npm version: rush 5.5.3, using pnpm 2.16.0
  • @google-cloud/pubsub version: 0.27.0 / 0.27.1

Steps to reproduce

  1. Import @google-cloud/pubsub into a TypeScript project
  2. Don’t enable "skipLibCheck": true (or explicitly set it to false in your tsconfig.json
  3. Try to build

Resulting errors (I’ve trimmed some very long paths that rush+pnpm generates):

<long-rush-path-1>/@google-cloud/pubsub/build/proto/iam.d.ts(2,23): error TS2307: Cannot find module 'long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/iam.d.ts(3452,40): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/iam.d.ts(3455,40): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/iam.d.ts(3483,46): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/iam.d.ts(3486,46): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(2,23): error TS2307: Cannot find module 'long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7060,40): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7063,40): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7091,46): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7094,46): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7687,31): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7703,37): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7957,31): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/proto/pubsub.d.ts(7973,37): error TS2304: Cannot find name 'Long'.
<long-rush-path-1>/@google-cloud/pubsub/build/src/message-queues.d.ts(19,24): error TS7016: Could not find a declaration file for module 'p-defer'. '<long-rush-path-4>/p-defer/index.js' implicitly has an 'any' type.
  Try `npm install @types/p-defer` if it exists or add a new declaration (.d.ts) file containing `declare module 'p-defer';`
<long-rush-path-2>/google-gax/build/src/streaming.d.ts(32,28): error TS7016: Could not find a declaration file for module 'duplexify'. '<long-rush-path-5>/duplexify/index.js' implicitly has an 'any' type.
  Try `npm install @types/duplexify` if it exists or add a new declaration (.d.ts) file containing `declare module 'duplexify';`
<long-rush-path-3>/grpc/index.d.ts(2,55): error TS7016: Could not find a declaration file for module 'protobufjs'. '<long-rush-path-6>/protobufjs/dist/protobuf.js' implicitly has an 'any' type.
  Try `npm install @types/protobufjs` if it exists or add a new declaration (.d.ts) file containing `declare module 'protobufjs';`
TypeScript: 17 semantic errors

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Been a bit kooky on my end, but I just tried updating one of our projects to 0.28.1 and setting skipLibCheck: false again, and the errors related to PubSub are indeed gone, thank you 😀

@mgabeler-lee-6rs just published a patch release. I think this might be the one 🤞

@JustinBeckwith those options already exist in the system test, but neither my local machine or CI can replicate the error. I’m just going to bite the bullet and manually edit the generated files until we get a proper fix in pbts.

@mgabeler-lee-6rs thanks for the speedy reply!

@JustinBeckwith what is the latest news for https://github.com/googleapis/nodejs-datastore/pull/358? I assume whatever the resolution is there, we’ll want the same thing here.

@JustinBeckwith I think so, but it would probably be best if @mgabeler-lee-6rs could let us know after we cut our next release.