Skip to content

missing @grpc/grpc-js dependency #664

@eli0shin

Description

@eli0shin

Environment details

  • OS: macOS 10.14.5
  • Node.js version: 8.13.x
  • npm version: 6.4.1
  • @google-cloud/pubsub version: 0.30.0

Steps to reproduce

(I noticed this when deploying cloud functions)

  1. npm install @google-cloud/pubsub
  2. import and use the library
  3. deploy functions.

Result:
Deployment error.
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module '@grpc/grpc-js'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/srv/node_modules/@google-cloud/pubsub/build/src/pubsub.js:24:14)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

Looking at the @google-cloud/pubsub module that was installed in my node_modules folder I noticed that while it requires @grpc/grpc-js in @google-cloud/pubsub/build/src/pubsub.js:24:14 but it is not listed in the package.json and does not exist inside of its node_modules folder.

This seemed weird so I added @grpcs/grpc-js as a dependency of my project and everything is working fine now.

If I am correct about this I am very happy to open a pull request with the dependency added.

Thanks!

Metadata

Metadata

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p0Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions