nextjs - 💡(How to fix) Fix Subpath import of workspace package fails [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
vercel/next.js#85514Fetched 2026-04-08 02:15:15
View on GitHub
Comments
3
Participants
2
Timeline
15
Reactions
0
Author
Participants
Timeline (top)
subscribed ×5commented ×3labeled ×2mentioned ×2

Error Message

  1. Open app in browser and you'll get an error. I expected the app to load normally. Instead I get an error: Module not found: Can't resolve '#internal-package'.

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: 1.22.21
  pnpm: 8.15.4
Relevant Packages:
  next: 16.0.2-canary.0 // Latest available version is detected (16.0.2-canary.0).
  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/fnberta/subpath-import-reproduction

To Reproduce

  1. Start the application with next dev
  2. Open app in browser and you'll get an error.

Current vs. Expected behavior

I expected the app to load normally. Instead I get an error: Module not found: Can't resolve '#internal-package'.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: 1.22.21
  pnpm: 8.15.4
Relevant Packages:
  next: 16.0.2-canary.0 // Latest available version is detected (16.0.2-canary.0).
  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 dev (local), next start (local)

Additional context

The same setup works fine when using webpack instead of turbopack.

extent analysis

TL;DR

  • The issue can likely be resolved by adjusting the import path or configuration to accommodate Turbopack's handling of internal packages.

Guidance

  • Verify that the #internal-package import is correctly configured and supported by Turbopack, as the issue does not occur with Webpack.
  • Check the Next.js documentation and Turbopack configuration options to see if there are specific settings or workarounds for handling internal packages.
  • Consider testing the application with a different import path or alias to see if the issue is specific to the #internal-package syntax.
  • Review the differences in configuration or setup between Webpack and Turbopack to identify potential causes for the discrepancy.

Example

No specific code snippet can be provided without more information on the #internal-package import and the project's configuration.

Notes

The solution may depend on the specific version of Next.js and Turbopack being used, as well as the project's configuration and setup. Further investigation and testing may be necessary to determine the root cause and find a suitable fix.

Recommendation

  • Apply workaround: Adjust the import path or configuration to accommodate Turbopack's handling of internal packages, as the issue is likely related to the difference in behavior between Webpack and Turbopack.

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