🐛 BUG: bundle problem when using googleapis
See original GitHub issueWhat version of Wrangler
are you using?
2.0.26
What operating system are you using?
Windows
Describe the Bug
I am using two google official libraries to develope some features.
“google-auth-library”: “^8.2.0”, https://github.com/googleapis/google-auth-library-nodejs
“googleapis”: “^105.0.0”, https://github.com/googleapis/google-api-nodejs-client
I wirite node_compat = true
on wrangler.toml
, and then I run npm run start
It says:
X [ERROR] Could not resolve "http2"
node_modules/googleapis-common/build/src/http2.js:16:22:
16 │ const http2 = require("http2");
│ ~~~~~~~
╵ "./http2"
The package "http2" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Errors | Cloud APIs - Google Cloud
Google APIs use a simple protocol-agnostic error model, which allows us to offer a consistent experience across different APIs, different API protocols ...
Read more >Error while publishing AAB to internal sharing console after ...
As the error suggests, I tried validating bundle on my local machine and it's absolutely working fine and I'm even able to install...
Read more >Error implementing GoogleApiClient Builder for Android ...
ConnectionCallbacks , it's asking for GoogleApiClient.ConnectionCallbacks . Try changing your implements to use the more-qualified class name.
Read more >Setup Instructions | API Client Library for Java
The Google API Client Library for Java (google-api-client) is designed to be compatible with all supported Java platforms, including Android.
Read more >Google APIs Node.js Client
Start using googleapis in your project by running `npm i googleapis`. ... This means that we will address critical bugs and security issues...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We won’t be able to fix this within wrangler but we’ve created an internal issue to try to improve
node_compat
within the workers runtime. We’ll be closing this ticket for nowYes I have tried adding
node_compat = true
but it resulted in the same issue as OP. Actually, with the same package too ofhttp2
.Node Version:
v16.13.1
For the time being I refactored my code to use the native
fetch
rather thangot
.