Google PubSub Import Error
See original GitHub issueEnvironment details OS: Windows Node.js version: v13.10.1 npm version: 6.13.7 Google Cloud SDK 293.0.0 bq 2.0.57 core 2020.05.15 gsutil 4.50
Steps to reproduce Importing @google-cloud/pubsub results in what looks like a combination of bootstrap and GRPC errors. I have included the stack trace and package.json for reference. The error appears to be an issue from google gax and grpc status codes (undefined).
stack trace: errorStackTrace.txt
package.json : package.txt
Steps I Have Taken That Did Not Fix -reinstalled Google Pub Sub through npm -removed all node-modules, cleared npm cache, and ran npm install -installed GRPC, attempted to import GRPC and use it to initialize PubSub -reinstalled Firebase through npm *deleted package-lock before reinstalling through npm
Reference This issue occurs just by importing PubSub, no initialization of PubSub or actual client-library code written. If I remove the import, my application runs and does not crash. I have attempted to import in two different ways and get the same result:
const {PubSub} = require('@google-cloud/pubsub'); //from the google docs
and
import PubSub from '@google-cloud/pubsub'
For reference, my application runs on React and heavily uses Firebase for real time data syncing. I am looking to use Google Pub Sub to communicate notifications to the main console of the application, and notifications will be published by many different sub-components throughout the application.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17 (4 by maintainers)
Top GitHub Comments
I somehow totally missed the browser connection there. After a bit of internal discussion, we don’t actually support using this library from a browser, but it’s an aspiration. It looks like what’s happening here is that it’s failing to load protos via gax, which is pretty understandable. (I think they are dynamically require()'d in.) So I’m going to flip this from a question to a feature request for working webpack support.
@oaguilar5 @qstrahl Thanks for the report. There are some TypeScript incompatibilities that were introduced when we moved up to the latest minor in Pub/Sub 2.0.0. I wonder if there’s something going on there, but I’ll try to look at this after fixing that other issue.