Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo self-referencing package imports don't resolve in certain cases with Turbopack #66487

Closed
timneutkens opened this issue Jun 3, 2024 · 3 comments
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. locked Turbopack Related to Turbopack with Next.js.

Comments

@timneutkens
Copy link
Member

Link to the code that reproduces this issue

#66486

To Reproduce

⚠️ I've already opened a failing test here: #66486

For the original reproduction these are the steps:

  1. Clone repository: https://github.com/juliusmarminge/turbo-self-referencing
  2. Run commands:
pnpm install
cd internal-pkg
pnpm build
cd ../next-app
pnpm dev
  1. Open http://localhost:3000
  2. Observe the error

Current vs. Expected behavior

Expected: No build error
Current:
CleanShot 2024-06-03 at 11 23 51@2x

./internal-pkg/dist/index.js:1:1
Module not found: Can't resolve '@repo/internal-pkg/env'
> 1 | import { env } from '@repo/internal-pkg/env';
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2 |
  3 | console.log({
  4 |     env

https://nextjs.org/docs/messages/module-not-found

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: <redacted>
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 18.20.2
  npm: 10.5.0
  Yarn: N/A
  pnpm: 8.15.7
Relevant Packages:
  next: 15.0.0-canary.7 // Latest available version is detected (15.0.0-canary.7).
  eslint-config-next: 15.0.0-canary.7
  react: 19.0.0-rc-f994737d14-20240522
  react-dom: 19.0.0-rc-f994737d14-20240522
  typescript: 5.3.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 build (local)

Additional context

No response

@timneutkens timneutkens added bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. labels Jun 3, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Jun 3, 2024
@github-actions github-actions bot closed this as completed Jun 3, 2024
@github-actions github-actions bot added the invalid link The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened. label Jun 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2024
@timneutkens timneutkens reopened this Jun 3, 2024
@vercel vercel deleted a comment from github-actions bot Jun 3, 2024
@vercel vercel unlocked this conversation Jun 3, 2024
@mischnic mischnic removed the invalid link The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened. label Jul 23, 2024
mischnic added a commit that referenced this issue Aug 7, 2024
I've simplified @timneutkens's tests from #66486
The resolver fix is in vercel/turborepo#8820

Closes #66486
Related issue: #66487

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
@vhpx

This comment has been minimized.

@mischnic
Copy link
Contributor

@vhpx Please open a new issue with a reproduction.

This specific case was fixed by vercel/turborepo#8820 / #68070

Copy link
Contributor

github-actions bot commented Oct 2, 2024

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Oct 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. locked Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants