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
I'm implementing authentication checks in Next.js middleware and using Vitest for unit testing these middlewares. However, when importing oauth4webapi, an error occurs.
Reproduction
Run npm install @auth0/nextjs-auth0 vitest to install the necessary packages.
Error: require() of ES Module /Users/zaru/Sites/node-sandbox/node-esm/node_modules/oauth4webapi/build/index.js from /Users/zaru/Sites/node-sandbox/node-esm/node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/edge-client.js not supported.
Instead, change the require of index.js in /Users/zaru/Sites/node-sandbox/node-esm/node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/edge-client.js to a dynamic import() which is available in all CommonJS modules.
❯ Object.<anonymous> node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/edge-client.js:5:36
❯ Object.<anonymous> node_modules/@auth0/nextjs-auth0/dist/edge.js:7:23
❯ async /Users/zaru/Sites/node-sandbox/node-esm/index.ts:1:31
❯ async /Users/zaru/Sites/node-sandbox/node-esm/index.test.ts:2:31
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
14.1.4
Node.js version
20.5.1
The text was updated successfully, but these errors were encountered:
Checklist
Description
I'm implementing authentication checks in Next.js middleware and using Vitest for unit testing these middlewares. However, when importing oauth4webapi, an error occurs.
Reproduction
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
14.1.4
Node.js version
20.5.1
The text was updated successfully, but these errors were encountered: