Compilation error when trying to use server actions (turbopack? |
nextjs?)
Hey guys, I'm recently trying to finish the authentication in my project and I've been having a lot of problems when implementing server actions recently.
When using a server action, my application automatically crashes and there's no way to fix it unless I delete the server actions and their use in my components. Currently the only thing that works for me are the Api routes.
I'll leave the error output right here and a screenshot of the error in the browser.
╭─[~/projects/arty]─[lost@Kokoro]─[0]─[2750]
╰─[:)] % bun run dev
$ next dev --turbopack
Using existing cloned repo
⠹ ▲ Next.js 15.2.1 (Turbopack)
- Local: http://localhost:3000
- Network: http://192.168.18.17:3000
- Environments: .env
- Experiments (use with caution):
· turbo
✓ authInterrupts
✓ Starting...
ℹ [paraglide] Compiling inlang project at "./project.inlang".
Using existing cloned repo
✓ Compiled in 4.6s
✓ Ready in 5.4s
○ Compiling / ...
✓ Compiled / in 1229ms
⨯ ./.next-internal/server/app/(main)/page/actions.js
ModuleId not found for ident: "[project]/.next-internal/server/app/(main)/page/actions.js [app-rsc] (server actions loader, ecmascript)"
ModuleId not found for ident: "[project]/.next-internal/server/app/(main)/page/actions.js [app-rsc] (server actions loader, ecmascript)"
✓ Compiled /_error in 418ms
GET / 500 in 1757ms
dependencies:
"next": "^15.2.1" | "v15.2.2-canary4",
"next-auth": "^5.0.0-beta.25",
"next-themes": "^0.4.4",
"react": "19.0.0",
"react-dom": "19.0.0",
"@auth/drizzle-adapter": "^1.8.0",
(others omitted to simplify it)
I have been having this problem for days and it prevents me from logging in with next-auth v5.
Thanks for the help in advance.