You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
The JOSE library seems to use a lot of the latest ES syntaxes introduced in Node 12: https://github.com/panva/jose Using the library in a project with Node 12.2.0 and ESM, when loading the library, this error is produced and the application fails to start.
node_modules/@panva/jose/lib/jwe/encrypt.js:77
[PROCESS_RECIPIENT] (recipient) {
^
SyntaxError: Invalid or unexpected token
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
You can easily reproduce this:
mkdir test
cd test
npm create
npm install esm
npm install panva/jose
Paste this to index.js:
const jose = require('@panva/jose')
const {
JWE, // JSON Web Encryption (JWE)
JWK, // JSON Web Key (JWK)
JWKS, // JSON Web Key Set (JWKS)
JWS, // JSON Web Signature (JWS)
JWT, // JSON Web Token (JWT)
errors // errors utilized by @panva/jose
} = jose
then run both node index.js and node -r esm index.js and you'll get the error when ESM is used.
The text was updated successfully, but these errors were encountered:
The JOSE library seems to use a lot of the latest ES syntaxes introduced in Node 12: https://github.com/panva/jose Using the library in a project with Node 12.2.0 and ESM, when loading the library, this error is produced and the application fails to start.
You can easily reproduce this:
Paste this to index.js:
then run both
node index.js
andnode -r esm index.js
and you'll get the error when ESM is used.The text was updated successfully, but these errors were encountered: