-
Notifications
You must be signed in to change notification settings - Fork 227
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 @grpc/grpc-js dependency #879
Comments
Thanks @JimPatterson for the report! There are some other issues going on regarding grpc-js, so I'll probably look at this in that context. |
@feywind @JimPatterson 👋 google-gax which is depended on by This sounds like it's potentially an issue with |
@bcoe I guess my quick triage of the question last week... the Pub/Sub code is directly require()'ing grpc-js. e.g.:
It seems like that's making some shaky assumptions about the availability of the grpc-js module to the pub/sub module. I'm guessing we decided to pull it in through gax to manage versions there, but it doesn't seem technically correct to me. On the other hand @JimPatterson as Ben was saying to me internally, I think we really only support using npm, so yarn and pnpm are a bit of a best effort kind of thing. I'm unsure we'll be changing this for non-npm use. |
I'm getting this issue too using npm on alpine. Adding |
I think that post-2.x I'm planning to just add Incidentally, there have been a lot of updates to |
I forgot to update this - we talked it over and decided it's probably best if Pub/Sub itself doesn't gain a direct dependency on As a workaround for package manager issues outside stock npm, sonu27's comment above should fix it. |
Environment details
@google-cloud/pubsub
version: 1.4.1Error seen
When trying to require pubsub, I get an error that @grpc/grpc-js can't found like:
The error is being seen due to the non-flat node_modules layout that pnpm uses where npm's flat style would likely not have seen the problem. But the real cause of the problem is due to pubsub having a require of grpc-js without declaring it as a dependency. I see older issue talking about this:
I'm not a Typescript user so I can't review the comment about only needing it for types, but https://github.com/googleapis/nodejs-pubsub/blob/master/src/publisher/publish-error.ts#L17 imports @grpc/grpc-js directly and the resultant javascript does also. This implies that there is a direct dependency on @grpc/grpc-js
The text was updated successfully, but these errors were encountered: