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
While starting a react project the Babel Loader fails to Parse: ./node_modules/jose/dist/browser/runtime/jwk_to_key.js
Issue is an unexpected token which is most likely the usage of ??.
Detailled Error
/node_modules/jose/dist/browser/runtime/jwk_to_key.js 121:36
Module parse failed: Unexpected token (121:36)
File was processed with these loaders:
./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| keyUsages
| } = subtleMapping(jwk);
I suspect the issue resides purely in the babel version, and i would be grateful if someone can say which babel-loader version is compatibel. Right now its. "babel-loader": "^9.2.1",
Technical Details
Implementation of jose is as follows:
const publicKey = await jose.importSPKI(spki, 'RS512');
//behold the empty object in the third parameter. This is where you would put the issuer and audience if you wanted to check them.
// if its removed it doesnt complie. so lets keep it in for now.
const { payload } = await jose.jwtVerify(token, publicKey,{}); '
Thanks in advance for any tipps. I know this is really not the problem of jose, but asking in babel will not yield any help. So all I can is asking here. Thank you very much in advance. :)
Version
5.9.6
Runtime
Node.js
Runtime Details
node v22.12.0, npm 10.9.0
Code to reproduce
SeeTicketDescription.constpublicKey=awaitjose.importSPKI(spki,'RS512');//behold the empty object in the third parameter. This is where you would put the issuer and audience if you wanted to check them. // if its removed it doesnt complie. so lets keep it in for now.const{ payload }=awaitjose.jwtVerify(token,publicKey,{});ThiscodeisusedinanReactAppinaJWTDecoderClass.
Required
I have searched the issues tracker and discussions for similar topics and couldn't find anything related.
This discussion was converted from issue #744 on January 31, 2025 15:08.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What happened?
Summary
While starting a react project the Babel Loader fails to Parse: ./node_modules/jose/dist/browser/runtime/jwk_to_key.js
Issue is an unexpected token which is most likely the usage of ??.
Detailled Error
I suspect the issue resides purely in the babel version, and i would be grateful if someone can say which babel-loader version is compatibel. Right now its.
"babel-loader": "^9.2.1",
Technical Details
Implementation of jose is as follows:
Relevant npm packages used:
Personal Note
Thanks in advance for any tipps. I know this is really not the problem of jose, but asking in babel will not yield any help. So all I can is asking here. Thank you very much in advance. :)
Version
5.9.6
Runtime
Node.js
Runtime Details
node v22.12.0, npm 10.9.0
Code to reproduce
Required
Beta Was this translation helpful? Give feedback.
All reactions