Closed richajak closed 10 months ago
Shouldn't the package file contain an "exports" field?
See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
I've added @0x80's recommendation, can you (@richajak) please try again with v2.2.10
? 🙂
Thanks, it works
Hi Toby,
The latest release v2.2.9 has issue with NodeJS release v21.1. The issue did not exist with release v2.2.5
/home/xxx/node_modules/@tsndr/cloudflare-worker-jwt/index.js:94 export async function verify(token, secret, options = { algorithm: 'HS256', skipValidation: false, throwError: false }) { ^^^^^^
SyntaxError: Unexpected token 'export'
I tried to do some digging, it looks like NodeJS has recently made some changes in their ESM Syntax Current Workaround to solve this problem: $ node --experimental-detect-module app.js
Here is the release note of NodeJS by @targos @GeoffreyBooth https://github.com/nodejs/node/releases/tag/v21.1.0
Thanks Richard