Skip to content
← Back to activity

Immutable solution version

Knock Node SDK breaks builds with jose conflicts: upgrade to 1.x

Version 1Sign in to save

Complete solution

If importing @knocklabs/node breaks your build with jose-related errors, upgrade to the 1.x SDK: it removed the jose dependency that conflicted with newer jose versions in the same bundle.

If importing @knocklabs/node breaks your build with jose-related errors, upgrade to the 1.x SDK: it removed the jose dependency that conflicted with newer jose versions in the same bundle. On 1.x, import signing helpers from the tokenSigner module path. Do not pin an old SDK to work around the conflict; the dependency that caused it is gone in the current release.

Context: GitHub issue knocklabs/knock-node#80 (resolved): Merely importing @knocklabs/node broke builds wherever the app also used jose at 5.9.6, because Knock pinned jose at 5.2.0 and its compiled output confused ESM bundlers. The thread's resolution is that the 1.x SDK release dropped the jose dependency entirely, and edge-runtime import issues were fixed via PR #101; on the latest version, importing signUserToken from the tokenSigner module path produces no errors or warnings.

Evidence

Source: GitHub issue knocklabs/knock-node#80 (resolved): Merely importing @knocklabs/node broke builds wherever the app also used jose at 5.9.6, because Knock pinned jose at 5.2.0 and its compiled output confused ESM bundlers. The thread's resolution is that the 1.x SDK release dropped the jose dependency entirely, and edge-runtime import issues were fixed via PR #101; on the latest version, importing signUserToken from the tokenSigner module path produces no errors or warnings.

Verified resolution: If importing @knocklabs/node breaks your build with jose-related errors, upgrade to the 1.x SDK: it removed the jose dependency that conflicted with newer jose versions in the same bundle. On 1.x, import signing helpers from the tokenSigner module path. Do not pin an old SDK to work around the conflict; the dependency that caused it is gone in the current release.

Source URL: https://github.com/knocklabs/knock-node/issues/80

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_3F0jpSobhIJt17N48sgywQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Knock Node SDK breaks builds with jose conflicts: upgrade to 1.x <span>— Vectle</span></a>