Workers SDK Issue Reports

← Back to Dashboard

#6676 Importing @google-cloud/storage fails with nodejs_compat_v2

Recommendation:KEEP OPEN
Difficulty:n/a
Reasoning:

Valid bug affecting multiple @google-cloud packages. Root cause is workerd's nodejs_compat util.inherits() implementation - related to open workerd#4035. Multiple users confirmed, last updated Oct 2025.

Suggested Action:

Link to workerd#4035 as they share same root cause; keep open awaiting workerd fix

Analysis Report

Issue Review: cloudflare/workers-sdk#6676

Summary

Importing @google-cloud/storage fails with nodejs_compat_v2 due to TypeError: (init_inherits(...) , __toCommonJS(...)) is not a function in readable-stream dependency.

Findings

  • Created: 2024-09-11
  • Updated: 2025-10-30
  • Version: 3.76.0 → 4.60.0 (current)
  • Component: Wrangler / nodejs_compat_v2
  • Labels: bug
  • Comments: 3 (all confirming similar issues with other @google-cloud packages)

Key Evidence

  1. Multiple reporters confirm the issue - Comments mention the same error with @google-cloud/recaptcha-enterprise and @google-cloud/pubsub, indicating this is a broader problem with Google Cloud SDK packages.

  2. Related workerd issue exists - workerd#4035 reports a very similar error (The "superCtor.prototype" property must be of type object) when using packages that depend on readable-stream and util.inherits(). That issue is still open with recent activity (September 2025).

  3. Root cause appears to be in workerd - The error occurs in the node:util inherits function when superCtor is undefined. Comments on workerd#4035 from maintainer @anonrig confirm: "It seems node:util inherits method is receiving an undefined value, whereas it should receive an object."

  4. No fix found in changelogs or PRs - No merged PRs reference this issue, and the wrangler changelog doesn't mention any fixes for this error.

  5. Workaround exists - Users on workerd#4035 have found success by avoiding packages that use readable-stream in favor of alternatives (e.g., using jose instead of jsonwebtoken).

  6. Issue is not stale - Last updated October 2025, with related workerd issue active as of September 2025.

Recommendation

Status: KEEP OPEN

Reasoning: This is a legitimate, reproducible bug affecting multiple Google Cloud SDK packages. The root cause appears to be in workerd's nodejs_compat implementation of node:util.inherits(). The related workerd#4035 is still open and being actively investigated. Multiple users have confirmed the issue persists with current versions.

Action:

  1. Link this issue to workerd#4035 as they share the same root cause
  2. Add label to indicate this is waiting on upstream workerd fix
  3. Consider closing as duplicate of or linking to a tracking meta-issue for nodejs_compat compatibility problems

Suggested Comment

This issue appears to share the same root cause as cloudflare/workerd#4035 - the node:util.inherits() implementation in workerd's nodejs_compat receives an undefined superCtor value when certain packages (including @google-cloud/* packages that depend on readable-stream) are bundled.

The workerd team is aware of this class of issues. In the meantime, if you need to use Google Cloud services from Workers, you may need to:

  1. Use REST API directly instead of the SDK
  2. Use alternative libraries that don't depend on readable-stream

Linking to workerd#4035 for tracking.

Notes & Feedback (0)

No notes yet.

Add Note