Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node module 'perf_hooks' in edge runtime #12406

Open
ywwa opened this issue Dec 19, 2024 · 1 comment
Open

node module 'perf_hooks' in edge runtime #12406

ywwa opened this issue Dec 19, 2024 · 1 comment
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@ywwa
Copy link

ywwa commented Dec 19, 2024

Adapter type

@auth/drizzle-adapter

Environment

  System:
    OS: Linux 6.11 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 25.02 GB / 31.27 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
    npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
    pnpm: 9.15.0 - ~/.nvm/versions/node/v22.9.0/bin/pnpm
    bun: 1.1.34 - ~/.bun/bin/bun
  npmPackages:
    @auth/drizzle-adapter: ^1.7.4 => 1.7.4
    next: 15.1.2 => 15.1.2
    next-auth: 5.0.0-beta.25 => 5.0.0-beta.25
    react: ^19.0.0 => 19.0.0

Reproduction URL

https://github.com/ywwa/NextJsAuthJsReprod

Describe the issue

When setting up Auth.js (next-auth@beta) with drizzle adapter and using middleware nextjs server (edge runtime) throws adapter error.

[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: Error: The edge runtime does not support Node.js 'perf_hooks' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
    at Object.get (/app/.next/server/edge/chunks/_3fb3d8._.js:62:19)
    at createSocket (/app/.next/server/edge/chunks/1350d_postgres_src_2fa65c._.js:815:273)
    at Timeout.connect [as _onTimeout] (/app/.next/server/edge/chunks/1350d_postgres_src_2fa65c._.js:969:35)
    at listOnTimeout (node:internal/timers:581:17)
    at process.processTimers (node:internal/timers:519:7)
[auth][details]: {}

How to reproduce

  1. Setup reproduction project (change variables in compose.yaml)
  2. clear localStorage and cookies if any
  3. look at logs and see that everything is file
  4. navigate to localhost:3000 and click on Sign in button
  5. look at logs again and see the error message

Expected behavior

Using middleware should not throw any errors in console

@ywwa ywwa added adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Dec 19, 2024
@elmaystero
Copy link

facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants