-
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.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: #202312131837 SMP PREEMPT_DYNAMIC Wed Dec 13 19:05:40 UTC 2023
Binaries:
Node: 20.11.0
npm: 10.2.4
Yarn: 1.22.19
pnpm: 8.14.1
Relevant Packages:
next: 14.1.1-canary.17 // Latest available version is detected (14.1.1-canary.17).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
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
No response
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.locked