Unexpected Turbopack Error: AliasMap::lookup panicked in Next.js #74214
Labels
bug
Issue was opened via the bug report template.
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/sweet-nova-x2vydg
To Reproduce
Steps to Reproduce:
Current vs. Expected behavior
Current Behavior:
Turbopack throws a panic due to alias resolution errors.
The following error appears in the logs:
Dynamic imports and
useRouter
fromnext/navigation
seem to trigger this error.The server crashes or hangs with the error preventing any further development.
Expected Behavior:
useRouter
fromnext/navigation
and handling dynamic imports correctly.npm run dev
ornext dev --turbopack -H 0.0.0.0
command should start the server without triggering a panic in Turbopack.Which area(s) are affected? (Select all that apply)
create-next-app
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), Vercel (Deployed)
Additional context
The error seems to be related to Turbopack's alias resolution system, potentially with dynamic and constant alias resolution conflicts.
I am using Next.js with the --turbopack flag for bundling.
Possible Solutions or Workaround:
The issue appears to be related to how Turbopack handles dynamic imports and alias resolution, which may involve some conflicting configurations.
It might be related to the use of constants and dynamic variables within the project.
I'm using Next.js 15.0.3 with the --turbopack flag enabled for bundling.
I have also confirmed that my project uses React 18.3.1 and React-DOM 18.3.1, which might be relevant to the problem.
The issue may be occurring specifically with the newer versions of Turbopack, which is under active development, and it may not have stable handling for certain dynamic import patterns.
Dependenices
Dev Dependencies
The text was updated successfully, but these errors were encountered: