-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.locked
Description
Link to the code that reproduces this issue
https://github.com/Maclay74/nextjs-turbopack-dynamic-import-bug
To Reproduce
- Start application via
npm run dev - Check console output, it should provide correct values from modules
- Restart application via
npm run dev-turbo - Check console output, names are wrong
Current vs. Expected behavior
Turbopack should import modules without caching them.
Current :
{ name: 'First', fileName: 'first.tsx' }
{ name: 'First', fileName: 'second.tsx' }
{ name: 'First', fileName: 'third.tsx' }Expected:
{ Name: 'First', fileName: 'first.tsx' }
{ Name: 'Second', fileName: 'second.tsx' }
{ Name: 'Third', fileName: 'third.tsx' }Moreover, there is inconsistent behavior related to hot-reloading of the page.
Page has some dynamic imports and when content of any of these modules is changes, it should trigger page reloading, as it depends on it.
Turbopack indeed does that, while webpack doesn't trigger page, although it recomplies the changed module.
To reproduce that, change files/first.tsx and see that with --turbo the page is reloaded and it didn't without it.
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 19.8.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 13.5.5-canary.3
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack (--turbo)
Additional context
No response
vizet, dcporter44 and gadcam
Metadata
Metadata
Assignees
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.locked