nextjs - 💡(How to fix) Fix [Turbopack]: fails to resolve imports with node subpath aliases

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: Turbopack build failed with 2 errors: ./src/app Module not found: Can't resolve '#/greeting' https://nextjs.org/docs/messages/module-not-found ./src/app/page.tsx:1:1 Module not found: Can't resolve '#/greeting'

Code Example

"imports": {
    "#/*": "./src/*"
  },

---

Error: Turbopack build failed with 2 errors:
./src/app
Module not found: Can't resolve '#/greeting'
https://nextjs.org/docs/messages/module-not-found
./src/app/page.tsx:1:1
Module not found: Can't resolve '#/greeting'

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:12 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6050
  Available memory (MB): 36864
  Available CPU cores: 18
Binaries:
  Node: 24.15.0
  npm: 11.12.1
  Yarn: 1.22.22
  pnpm: 11.1.1
Relevant Packages:
  next: 16.3.0-canary.36 // Latest available version is detected (16.3.0-canary.36).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/tarungunampalli-rox/turbopack-imports-repro

To Reproduce

  1. Add imports field to package.json
  "imports": {
    "#/*": "./src/*"
  },
  1. Import some internal src file starting with the # subpath alias
  2. run build with turbopack

Current vs. Expected behavior

Logs from the reproduction show

Error: Turbopack build failed with 2 errors:
./src/app
Module not found: Can't resolve '#/greeting'
https://nextjs.org/docs/messages/module-not-found
./src/app/page.tsx:1:1
Module not found: Can't resolve '#/greeting'

I expect turbopack should be able to resolve internal imports using the #/ subpath alias

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:12 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6050
  Available memory (MB): 36864
  Available CPU cores: 18
Binaries:
  Node: 24.15.0
  npm: 11.12.1
  Yarn: 1.22.22
  pnpm: 11.1.1
Relevant Packages:
  next: 16.3.0-canary.36 // Latest available version is detected (16.3.0-canary.36).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
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), Vercel (Deployed)

Additional context

Both latest canary (16.3.0-canary.36) and 16.2.6 are seeing this issue

This related issue seems like it was only resolved for external imports. Internal imports seem to still not resolve correctly

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING