next-auth
next-auth copied to clipboard
TypeError: r is not a function. When using Lazy NextAuth initialization.
Environment
(base) waylon@macbook-pro-m1 auth % npx envinfo --system --binaries --browsers --npmPackages "{next,react,next-auth,@auth/*}"
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
System:
OS: macOS 13.2
CPU: (10) arm64 Apple M1 Pro
Memory: 105.25 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 22.5.1 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
Watchman: 2022.06.13.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 127.0.6533.90
Safari: 16.3
npmPackages:
next: 14.2.5 => 14.2.5
next-auth: ^5.0.0-beta.20 => 5.0.0-beta.20
react: ^18 => 18.3.1
Reproduction URL
https://github.com/Waylon-Firework/next-auth-lazy-init/tree/lazy-init
Describe the issue
Call api will show error when using lazy init: http://localhost:3000/api/protected
How to reproduce
call the api: http://localhost:3000/api/protected
Expected behavior
no error