Skip to content

Regression: @google-cloud/pubsub fails to run due to JWA dependency in google-auth-library for node v24.0.0-rc.3 and later #1964

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

Open
abhilash-sivan opened this issue May 5, 2025 · 3 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@abhilash-sivan
Copy link

Hello team,

I'm encountering a failure when using the @google-cloud/pubsub package with Node.js versions v24.0.0-rc.3 and later. The issue appears to be related to a transitive dependency within the google-auth-library-nodejs package.

The following code, which works reliably on earlier Node.js versions, now fails starting from v24.0.0-rc.3:

const [topic] = await pubSubClient.topic(topicName);

Error:

/Users/abhi/instana/test-apps/pubsub/node_modules/buffer-equal-constant-time/index.js:37
var origSlowBufEqual = SlowBuffer.prototype.equal;
                                  ^

TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous> (/Users/abhi/instana/test-apps/pubsub/node_modules/buffer-equal-constant-time/index.js:37:35)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
    at Object..js (node:internal/modules/cjs/loader:1899:10)
    at Module.load (node:internal/modules/cjs/loader:1469:32)
    at Function._load (node:internal/modules/cjs/loader:1286:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/abhi/instana/test-apps/pubsub/node_modules/jwa/index.js:1:19)

Node.js v24.0.0-rc.3

The issue is with a dependency in googleapis/google-auth-library-nodejs pkg.

  • Works fine in: v24.0.0-rc.2 and earlier
  • Fails in: v24.0.0-rc.3, v24.0.0-rc.4

🔍 Root Cause Investigation
After investigating the dependency tree, I’ve identified the root cause:

  1. google-cloud/pubsub depends on google-auth-library-nodejs
→ pubsub package.json
  2. google-auth-library-nodejs depends on jws
→ auth-library package.json
  3. jws uses jwa
→ jws package.json
  4. jwa depends on buffer-equal-constant-time
→ jwa package.json

The issue appears to stem from a problem in the jwa dependency chain.

📎 Related Issues & Discussions

Thanks In Advance

@d-goog
Copy link
Collaborator

d-goog commented May 6, 2025

It looks like slowbuffer was runtime deprecated rather than removed:

I'll investigate further.

@d-goog
Copy link
Collaborator

d-goog commented May 6, 2025

Actually, it has been removed entirely:

Making this a P1.

@d-goog d-goog self-assigned this May 6, 2025
@d-goog d-goog added priority: p0 Highest priority. Critical issue. P0 implies highest priority. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels May 6, 2025
@panva
Copy link

panva commented May 7, 2025

Both runtime-deprecation and EOL happened in the same major, that shouldn't have happened. nodejs/node#58211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

3 participants