When using the library with Yarn 3 (via google-cloud/spanner) module resolution is failing at runtime because protobufjs/minimal is referenced from build/src/generated/ but the transitive dependency on protobufjs is not declared in package json.
Error: grpc-gcp tried to access protobufjs, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: protobufjs (via "protobufjs/minimal")
Required by: grpc-gcp@npm:1.0.1 (via /.yarn/cache/grpc-gcp-npm-1.0.1-d26546ce0e-ad6608b982.zip/node_modules/grpc-gcp/build/src/generated/)
Require stack:
- .yarn/cache/grpc-gcp-npm-1.0.1-d26546ce0e-ad6608b982.zip/node_modules/grpc-gcp/build/src/generated/grpc_gcp.js
- .yarn/cache/grpc-gcp-npm-1.0.1-d26546ce0e-ad6608b982.zip/node_modules/grpc-gcp/build/src/index.js
- .yarn/cache/@google-cloud-spanner-npm-6.11.0-4009155329-6a21287f0f.zip/node_modules/@google-cloud/spanner/build/src/index.js
- workspaces/common/src/cloud-spanner.ts
When using the library with Yarn 3 (via google-cloud/spanner) module resolution is failing at runtime because protobufjs/minimal is referenced from
build/src/generated/
but the transitive dependency on protobufjs is not declared in package json.Environment details
grpc-gcp
version: 1.0.1Steps to reproduce
yarn install
yarn node main.js
You should see the error above. Adding
"protobufjs": "^7.2.3"
to the dependencies inpackage.json
fixes the problem.