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
When switching to middleware on an existing install, the following message appears when I build nextjs:
A Node.js API is used (process.versions at line: 6) which is not supported in the Edge Runtime.Import trace for requested module:../../node_modules/jose/dist/browser/runtime/jwk_to_key.js (...)./src/middleware.ts
By looking at installed version (in the lock file):
Environment
System:
OS: Linux 5.14 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Memory: 3.48 GB / 15.30 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 4.0.0-rc.18 - ~/.nvm/versions/node/v16.17.0/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Browsers:
Chrome: 105.0.5195.125
Firefox: 104.0.2
Reproduction URL
belgattitude/nextjs-monorepo-example#2622
Describe the issue
When switching to middleware on an existing install, the following message appears when I build nextjs:
By looking at installed version (in the lock file):
The problem was fixed upstream in the jose library (starting from v4.8.0).
As next-auth depends on an older version (^4.3.7) and jose is a transitive dependency it wasn't updated to latest
Workarounds:
PR
#5372
How to reproduce
You can test it out by cloning belgattitude/nextjs-monorepo-example#2622 before the commit belgattitude/nextjs-monorepo-example@f7d8b1f (which update the lock to latest jose version).
Expected behavior
No error message when building nextjs and using middlewares (vercel)
The text was updated successfully, but these errors were encountered: