Fix jose Library JWT Key Format Error in Node.js v24
· 2 min read
Encountered this issue while upgrading Node.js version for an enterprise SaaS system. Documenting the root cause and solution.
TL;DR
Node.js v24 changed Web Crypto API implementation. The jose library now requires keys to be KeyObject or CryptoKey type. Wrap your key with crypto.createSecretKey() to fix.