FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

turbopack fails to resolve subpath imports in dynamic `import()` statements with a placeholder · Issue #97533 · vercel/next.js · GitHub

/ next.js Public

turbopack fails to resolve subpath imports in dynamic import() statements with a placeholder #97533

Description

Link to the code that reproduces this issue

https://github.com/stefanprobst/issue-turbopack-subpath-imports

To Reproduce

  • clone repo
  • pnpm install
  • pnpn build

Current vs. Expected behavior

turbopack fails to resolve subpath imports (starting with #/*, configured in package.json) in dynamic import() statements with a placeholder, e.g.:

await import(`#/messages/${locale}/index.json`);

Error:

Error: Module not found: Can't resolve ('#/messages/' <dynamic> '/index.json' | '#/messages/en/index.json')
PackageInternal requests can only be Constant strings

Note that the same works fine when using either relative paths, or typescript path aliases, e.g.:

await import(`../../messages/${locale}/index.json`);
await import(`@/messages/${locale}/index.json`);

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #28~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul  1 15:50:57 UTC 2
  Available memory (MB): 32035
  Available CPU cores: 4
Binaries:
  Node: 24.19.0
  npm: N/A
  Yarn: N/A
  pnpm: 11.20.0
Relevant Packages:
  next: 16.3.1-canary.21 // There is a newer canary version (16.3.1-canary.24) available, please upgrade! 
  eslint-config-next: N/A
  react: 19.2.8
  react-dom: 19.2.8
  typescript: 7.0.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next build (local), next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL