Update dependency jose to v6#426
Conversation
|
7718be4 to
5df213d
Compare
67e5632 to
2c50058
Compare
1816661 to
fd8587d
Compare
827e138 to
4c738b2
Compare
4c738b2 to
05e49d0
Compare
70f3963 to
9d344d5
Compare
9d344d5 to
3eec058
Compare
3eec058 to
cb5237e
Compare
dd25909 to
e0074ea
Compare
e0074ea to
b5b5c5e
Compare
7d7fb64 to
0e69006
Compare
0e69006 to
51f63fd
Compare
51f63fd to
7904266
Compare
| "@livekit/protocol": "^1.43.1", | ||
| "camelcase-keys": "^9.0.0", | ||
| "jose": "^5.1.2" | ||
| "jose": "^6.0.0" |
There was a problem hiding this comment.
🔴 Package engines field claims Node.js >=18 but jose v6 drops Node.js 18 support and breaks CJS on Node <22
Updating jose to ^6.0.0 without updating the engines field creates a compatibility mismatch. The package declares "node": ">=18" but jose v6 explicitly drops support for Node.js 18.x and earlier. More critically, jose v6 states: "CJS-style require is now only possible when require(esm) support is present in the Node.js runtime" (require(esm) was added in Node.js 22).
Impact on CJS consumers
The package exports a CJS entry point at packages/livekit-server-sdk/package.json:24 ("default": "./dist/index.cjs"). Since jose is a runtime dependency (not bundled), the CJS build will attempt to require('jose') at runtime. On Node.js versions 18–21, this will fail because jose v6 ships only ESM and those runtimes do not support require(esm). Users on Node.js 18 or 20 (both current LTS lines) who consume livekit-server-sdk via require() will get a runtime error.
The engines field at line 65 should be updated to reflect the actual minimum Node.js version required by the dependency graph (at minimum >=20, or >=22 if CJS support is needed).
Prompt for agents
Update the engines field in packages/livekit-server-sdk/package.json (currently at line 65: "node": ">=18") to reflect the minimum Node.js version required by jose v6. At minimum, change it to "node": ">=20" (jose v6 drops Node 18 support). If CJS consumers need to be supported, change it to "node": ">=22" since jose v6's CJS-style require only works with Node.js require(esm) support (added in Node 22). Alternatively, consider configuring tsup to bundle jose into the CJS output so CJS consumers on older Node.js versions are not affected.
Was this helpful? React with 👍 or 👎 to provide feedback.
3923612 to
ddaff0a
Compare
a43bfcf to
ee9d6f5
Compare
ee9d6f5 to
5bdcc7e
Compare
c49cfbe to
d957f75
Compare
d957f75 to
5a88642
Compare
5a88642 to
24f43a5
Compare
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 setNotBefore(new Date()) is incompatible with jose v6 which removed Date parameter support (packages/livekit-server-sdk/src/AccessToken.ts:206)
jose v6 removed support for Date instances in setNotBefore(), setExpirationTime(), and setIssuedAt() — these methods now only accept number | string. The call at AccessToken.ts:206 passes new Date(), which is no longer a valid argument after this version bump. This will cause a type error at build time and incorrect behavior at runtime if type checks are bypassed (a Date object would be coerced to its string representation rather than being treated as an epoch timestamp).
View 8 additional findings in Devin Review.
24f43a5 to
265b2a5
Compare
265b2a5 to
7832d90
Compare
dab711d to
50afa76
Compare
50afa76 to
1b3c03a
Compare
There was a problem hiding this comment.
🚩 No code changes accompany the major version bump
This PR bumps jose from v5 to v6 (a major version) but includes zero code changes. Major version bumps typically include breaking changes. While the existing tests may pass if all used APIs remain compatible, the lack of any accompanying code changes warrants careful review of the jose v6 migration guide to ensure no behavioral changes affect JWT generation or verification.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
🚩 CJS export path may break on Node.js < 22 with jose v6
The package declares a CJS export at dist/index.cjs (line 24). jose v6 explicitly states that CJS-style require only works when require(esm) support is present in the Node.js runtime, which was introduced in Node.js 22. If tsup does NOT bundle jose into the CJS output (which is the default behavior for packages listed in dependencies), then CJS consumers on Node.js 18–21 will get a runtime error when the generated require('jose') call fails. This should be verified by checking the tsup configuration (tsup.config.ts or the tsup field in package.json) to see if noExternal: ['jose'] or similar bundling configuration is in place.
(Refers to lines 22-25)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
🚩 No changeset included for the jose major version bump
The three .changeset/*.md files in this PR are all for @livekit/rtc-node (patch-level changes). There is no changeset entry for livekit-server-sdk despite bumping a major dependency (jose v5→v6). While this doesn't cause a runtime bug, it means this dependency change won't be reflected in the changelog or trigger a version bump for livekit-server-sdk. If jose v6 is considered a meaningful change for downstream consumers (e.g., due to transitive dependency resolution or peer dependency constraints), a changeset should be added.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "@livekit/protocol": "^1.46.3", | ||
| "camelcase-keys": "^9.0.0", | ||
| "jose": "^5.1.2" | ||
| "jose": "^6.0.0" |
There was a problem hiding this comment.
🟡 clockTolerance parameter type allows string but jose v6 only accepts number
In jose v6, the clockTolerance option in jwtVerify only accepts a number (seconds), not a string. However, TokenVerifier.verify() at AccessToken.ts:228 declares clockTolerance: string | number, which allows callers to pass a string (e.g., '10s'). While the default value (defaultClockToleranceSeconds = 10) is a number and won't cause issues for default usage, any caller that passes a string will get a runtime error from jose v6.
Prompt for agents
In packages/livekit-server-sdk/src/AccessToken.ts line 228, change the clockTolerance parameter type from 'string | number' to just 'number' to match jose v6's API. The current signature is:
async verify(token: string, clockTolerance: string | number = defaultClockToleranceSeconds): Promise<ClaimGrants>
It should become:
async verify(token: string, clockTolerance: number = defaultClockToleranceSeconds): Promise<ClaimGrants>
Note: this is a public API change for the SDK, so callers passing strings will need to be updated. This is a breaking change in the SDK's own API surface.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "@livekit/protocol": "^1.46.3", | ||
| "camelcase-keys": "^9.0.0", | ||
| "jose": "^5.1.2" | ||
| "jose": "^6.0.0" |
There was a problem hiding this comment.
🚩 engines field claims Node.js 18 support but jose v6 drops it
The engines field at packages/livekit-server-sdk/package.json:65 specifies "node": ">=18", but jose v6's release notes explicitly state "drop support for Node.js 18.x and earlier." While Node.js 18 reached EOL in April 2025, the SDK still advertises support. The engines field should likely be updated to >=20 to match the actual minimum supported runtime. This is a documentation/configuration concern rather than a code bug — actual runtime failures depend on which Node.js 18 features jose v6 relies on (e.g., WebCryptoAPI completeness).
Was this helpful? React with 👍 or 👎 to provide feedback.
This PR contains the following updates:
^5.1.2→^6.0.0Release Notes
panva/jose (jose)
v6.2.3Compare Source
Refactor
v6.2.2Compare Source
Fixes
v6.2.1Compare Source
Refactor
v6.2.0Compare Source
Features
Documentation
v6.1.3Compare Source
Refactor
v6.1.2Compare Source
Refactor
v6.1.1Compare Source
Documentation
Refactor
v6.1.0Compare Source
Features
v6.0.13Compare Source
Refactor
v6.0.12Compare Source
Documentation
Refactor
v6.0.11Compare Source
Fixes
v6.0.10Compare Source
Refactor
v6.0.9Compare Source
Documentation
Refactor
v6.0.8Compare Source
Fixes
v6.0.7Compare Source
Documentation
Fixes
v6.0.6Compare Source
Refactor
Documentation
v6.0.5Compare Source
Refactor
Documentation
v6.0.4Compare Source
Refactor
v6.0.3Compare Source
Documentation
v6.0.2Compare Source
Documentation
v6.0.1Compare Source
Refactor
v6.0.0Compare Source
⚠ BREAKING CHANGES
Features
Refactor
Ed25519JWS Algorithm Identifier support (7a94cb9)v5.10.0Compare Source
Features
Ed25519algorithm identifier (c39f57d)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.