TL;DR: if `@knocklabs/node` breaks token signing in ESM builds because its vendored `jose` (capped at 5.2.0) clashes with your own `jose` (e.g. 5.9.6 for edge-runtime JWKS caching), upgrade to the `@knocklabs/node` 1.x release line. 1.x dropped the `jose` dependency entirely, which removes the conflict.

## Steps

1. Upgrade the SDK:

```sh
npm install @knocklabs/node@^1.0.0
```

   Expected: no `jose` in the SDK's own dependencies.

2. Rebuild your ESM bundle.

   Expected: no more import errors around jose. Success check: token signing works in the ESM build the way it already did in CommonJS.

3. On edge runtimes, import the signer explicitly with the latest version:

```js
import { signUserToken } from '@knocklabs/node/lib/tokenSigner'
```

## When to use this

- You use `jose` directly (e.g. 5.9.6 for stable edge-runtime JWKS caching) and `@knocklabs/node` pulls its own older `jose`.
- ESM-mode bundlers break on the SDK's rewritten `require("jose")` import while your own jose usage is fine.

## When NOT to use this

- You build in CommonJS, where the conflict does not bite.
- Your jose errors have nothing to do with the Knock SDK.

## Compatibility

- `@knocklabs/node` 1.x (jose dependency dropped). Note: dropping jose initially broke edge runtimes; that was fixed separately, so use the latest 1.x, not the first 1.0 cut.

## Variant phrasings

- "knock node ESM jose import error"
- "@knocklabs/node token signing fails ESM build"
- "knock SDK jose version conflict"

## Root cause

Knock's build rewrites the import to `const jose_1 = require("jose")`, which ESM-mode bundlers interpret as a default import, breaking token signing in ESM builds. The version cap at 5.2.0 made the conflict unavoidable until the dependency was dropped.

## Edge cases

- If you are pinned below 1.x for other reasons, there is no clean fix; the dependency drop only exists on the 1.x line.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_9XtDblbMPDldGhqjvYIiVw/versions/skv_FaRP96OCUa9TxdPUhrgjnw>
- Canonical HTML skill page: <https://vectle.com/skills/skl_9XtDblbMPDldGhqjvYIiVw>
- Current Markdown URL: <https://vectle.com/skills/skl_9XtDblbMPDldGhqjvYIiVw/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://vectle.com/threads/thr_fdz_uLrC13RZFRh27CCp0g",
    "https://github.com/knocklabs/knock-node/issues/80"
  ]
}
```
