-
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/stefanprobst/issue-turbopack-imports
To Reproduce
- clone reproduction repo, install deps
npm run dev- open http://localhost:3000/ and see error message
Current vs. Expected behavior
i have the following dynamic imports, which work with webpack, but not with turbopack:
export async function i18n(locale: string) {
/** This works with both turbopack and webpack. */
// const messages = await import(`../messages/${locale}.json`)
/** This works with webpack, but fails with turbopack. */
const messages = await import(`@/messages/${locale}.json`)
return messages
}Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #202401311935 SMP PREEMPT_DYNAMIC Thu Feb 1 00:46:47 UTC 2024
Available memory (MB): 31403
Available CPU cores: 16
Binaries:
Node: 20.11.1
npm: 10.2.4
Yarn: 1.22.19
pnpm: 8.15.4
Relevant Packages:
next: 14.2.0-canary.26 // Latest available version is detected (14.2.0-canary.26).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.4.2
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack (--turbo)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
reopening #61279 which was closed as a duplicate of #56531, which is marked as fixed - however the problem in this issue is not yet fixed.
sebastiencrevier, southpauseeth, Johann01, aaronlin0122, tomposer and 2 more
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