cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.75k stars 734 forks source link

🐛 BUG: Importing @google-cloud/storage fails with Uncaught TypeError: (init_inherits(...) , __toCommonJS(...)) is not a function with nodejs_compat_v2 #6676

Open miunau opened 2 months ago

miunau commented 2 months ago

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.76.0 [Wrangler]

What version of Node are you using?

22.6.0

What operating system and version are you using?

MacOS Sonoma 14.4.1

Describe the Bug

Observed behavior

Including @google-cloud/storage fails with the latest node compat.

wrangler dev:

Uncaught TypeError: (init_inherits(...) , __toCommonJS(...)) is not a function

    at null.<anonymous> (index.js:28993:54) in
  ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js

Expected behavior

Importing should work.

Steps to reproduce

Import @google-cloud/storage.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

helle253 commented 2 months ago

We are seeing a similar issue with the @google-cloud/recaptcha-enterprise.

groudjulien commented 2 months ago

We are seeing a similar issue with the @google-cloud/pubsub