auth0 / node-jwks-rsa

A library to retrieve RSA public keys from a JWKS (JSON Web Key Set) endpoint.
MIT License
836 stars 236 forks source link

getCurves is not a function #285

Closed gtgalone closed 2 years ago

gtgalone commented 2 years ago

error - node_modules/jwks-rsa/node_modules/jose/lib/registry/ec_curves.js (5:0) @ TypeError: getCurves is not a function

node v16.13.1 jwks-rsa v2.0.5

amrityam commented 2 years ago

Same issue with node v16.13.0 and jwks-rsa v2.0.5.

adamjmcgrath commented 2 years ago

@gtgalone @amrityam - this works for me on v16.13.2 https://replit.com/@AdamMcGrath/NervousMistyEquation

There's no reason why Node 16.13 shouldn't have crypto.getCurves

Can you provide an example replit.com that demonstrates the issue?

adamjmcgrath commented 2 years ago

Closing - feel free to provide a reproducible case if you want me to reopen

retr00exe commented 2 years ago

Hi, I am facing the same issue when trying to use jwks-rsa to verify JWT in Next.js middleware. There's some problem with the older version of jose package when try to import the built-in node module idk why, kindly check this issue. I think bump jose to v3 above will solve this problem.

image

retr00exe commented 2 years ago

Hi, can you reopen this issue and fix this problem? @adamjmcgrath

gablabelle commented 2 years ago

@adamjmcgrath @retr00exe I was facing the same problem using jwks-rsa in next.js. The function using jwks-rsa was being exported from the main entry point of one of my monorepo packages and that package was being imported client side.

So in order to solve the issue, I removed the export of that function from the main entry point and exported from another entry point that I only use server-side and now everything is cool.