Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Node 24 compatibility

Open
#992 23 comments 62 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, node.js

Research direction

Reproduce the failure with jsonwebtoken 9.0.2 on Node 24 using the provided jsonwebtoken.sign example, then inspect the nested jws > jwa > buffer-equal-constant-time dependency chain and the failing index.js line. Done means signing succeeds on Node 24 while preserving the working behavior on Node 22.

Written by the indexing model from the issue text.

Description

Description

jsonwebtoken doesn't work with Node 24. The buffer-equal-constant-time library throws an error:

Cannot read properties of undefined (reading 'prototype')

at

var origSlowBufEqual = SlowBuffer.prototype.equal;

buffer-equal-constant-time is a nested dep: jsonwebtoken > jws > jwa > buffer-equal-constant-time

Reproduction

Initialize a new Node project and install jsonwebtoken.

Run the following JS using Node 24.0.0

import jsonwebtoken from "jsonwebtoken";

jsonwebtoken.sign({ text: "test" }, "ABC");

Result:

var origSlowBufEqual = SlowBuffer.prototype.equal;
                                  ^

TypeError: Cannot read properties of undefined (reading 'prototype')
    at Object.<anonymous> (/Users/user/testnode24/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 Module._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/user/testnode24/node_modules/jwa/index.js:1:19)

Node.js v24.0.0
Environment
  • jsonwebtoken 9.0.2
  • Node 24.0.0
  • MacOS Sequoia

Running in Node 22 works without any issues.

Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.