Open MerlinMason opened 1 year ago
isn't compatible with Jest which we rely on heavily
jose
most certainly is compatible with any test runtime that exhibits the behaviours, globals, and module resolution representative of the actual target runtime. I'd be curious to learn more about your issue.
Nevertheless, if jsonwebtoken
were made to be Vercel Edge Runtime compatible it would undeniably have to depend on the same Web API primitives jose
relies on, leading to the same incompatibility with your jest setup.
It needs to be compatible with Vercel Edge runtime as soon as possible
Anyone else arriving here: Check out this hero! https://github.com/vercel/next.js/issues/43115#issuecomment-1321785193
Describe the problem you'd like to have solved
I'm currently using NextJS with it's Middleware feature which runs in the Vercel Edge Runtime - I would like to be able to verify JWTs here but due to the restrictions of the runtime it appears jsonwebtoken is not compatible.
Describe the ideal solution
Either compatibility with the whole library or a lighter weight verify function that can be used in this runtime.
Alternatives and current work-arounds
The jose library supports this, but isn't compatible with Jest which we rely on heavily.