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

next package can't be found when using --turbo and deno 2 rc in a monorepo #70600

Open
hamlim opened this issue Sep 29, 2024 · 1 comment
Open
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving) Turbopack Related to Turbopack with Next.js.

Comments

@hamlim
Copy link
Contributor

hamlim commented Sep 29, 2024

Link to the code that reproduces this issue

https://github.com/hamlim/deno-monorepo

To Reproduce

  1. Clone the repo
  2. Upgrade to deno 2 release candidate: deno upgrade rc (using at least 2.0.0-rc.7)
  3. Run deno install to install dependencies
  4. Run deno task dev --filter=docs (runs the docs Next app in development mode)
  5. Try to visit localhost:3000
  6. See error in terminal

Current vs. Expected behavior

Following the above steps - I'd expect the app to boot correctly, however it instead shows the following error in the terminal:

docs:dev: $ next dev --turbo
docs:dev:   ▲ Next.js 15.0.0-canary.140 (turbo)
docs:dev:   - Local:        http://localhost:3000
docs:dev:
docs:dev:  ✓ Starting...
docs:dev: [Error: Next.js package not found
docs:dev:
docs:dev: Debug info:
docs:dev: - Execution of get_entrypoints_with_issues failed
docs:dev: - Execution of Project::entrypoints failed
docs:dev: - Execution of PagesProject::to_endpoint failed
docs:dev: - Execution of PagesStructureItem::new failed
docs:dev: - Execution of FileSystemPath::join failed
docs:dev: - Execution of get_next_package failed
docs:dev: - Next.js package not found] {
docs:dev:   code: 'GenericFailure'
docs:dev: }

Note:

Removing --turbo on the dev task within apps/docs/package.json makes it work as expected.

My assumption is that turbopack (maybe) is unable to resolve the symlinked next package from the root node_modules (next is installed somewhere else with deno and then symlinked I think)

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: 24.0.0
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 20.11.1
  npm: 10.8.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.0-canary.140 // There is a newer canary version (15.0.0-canary.173) available, please upgrade!
  eslint-config-next: N/A
  react: 19.0.0-rc-7771d3a7-20240827
  react-dom: 19.0.0-rc-7771d3a7-20240827
  typescript: 5.4.5
Next.js Config:
  output: N/A
 ⚠ There is a newer canary version (15.0.0-canary.173) available, please upgrade!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

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

Module Resolution, Turbopack

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

next dev (local)

Additional context

Will attempt to replicate with the latest canary!

@hamlim hamlim added the bug Issue was opened via the bug report template. label Sep 29, 2024
@github-actions github-actions bot added Module Resolution Module resolution (CJS / ESM, module resolving) Turbopack Related to Turbopack with Next.js. labels Sep 29, 2024
@hamlim
Copy link
Contributor Author

hamlim commented Sep 29, 2024

The error is slightly different but still present in the latest canary (15.0.0-canary.173):

docs:dev: $ next dev --turbo
docs:dev:   ▲ Next.js 15.0.0-canary.173 (turbo)
docs:dev:   - Local:        http://localhost:3000
docs:dev:
docs:dev:  ✓ Starting...
docs:dev:  ✓ Ready in 2.8s
docs:dev:  ✓ Compiled / in 4ms
docs:dev:  ✓ Compiled /_error in 0ms
docs:dev:  ⨯ [Error: Next.js package not found
docs:dev:
docs:dev: Debug info:
docs:dev: - Execution of *get_written_endpoint_with_issues failed
docs:dev: - Execution of *PagesProject::to_endpoint failed
docs:dev: - Execution of *PagesStructureItem::new failed
docs:dev: - Execution of *FileSystemPath::join failed
docs:dev: - Execution of get_next_package failed
docs:dev: - Next.js package not found] {
docs:dev:   name: 'TurbopackInternalError'
docs:dev: }
docs:dev: [Error: Failed to write app endpoint /page
docs:dev:
docs:dev: Caused by:
docs:dev: - Next.js package not found
docs:dev:
docs:dev: Debug info:
docs:dev: - Execution of get_written_endpoint_with_issues failed
docs:dev: - Execution of <AppEndpoint as Endpoint>::write_to_disk failed
docs:dev: - Failed to write app endpoint /page
docs:dev: - Execution of AppEndpoint::output failed
docs:dev: - Execution of *get_app_page_entry failed
docs:dev: - Execution of *ModuleAssetContext::new failed
docs:dev: - Execution of get_server_module_options_context failed
docs:dev: - Execution of get_transpiled_packages failed
docs:dev: - Execution of *FileSystem::read failed
docs:dev: - Execution of *FileSystemPath::fs failed
docs:dev: - Execution of *FileSystemPath::join failed
docs:dev: - Execution of get_next_package failed
docs:dev: - Next.js package not found] {
docs:dev:   name: 'TurbopackInternalError'
docs:dev: }
docs:dev:  ⨯ [Error: Next.js package not found
docs:dev:
docs:dev: Debug info:
docs:dev: - Execution of *get_written_endpoint_with_issues failed
docs:dev: - Execution of *PagesProject::to_endpoint failed
docs:dev: - Execution of *PagesStructureItem::new failed
docs:dev: - Execution of *FileSystemPath::join failed
docs:dev: - Execution of get_next_package failed
docs:dev: - Next.js package not found] {
docs:dev:   name: 'TurbopackInternalError'
docs:dev: }
docs:dev: [Error: Next.js package not found
docs:dev:
docs:dev: Debug info:
docs:dev: - Execution of *get_written_endpoint_with_issues failed
docs:dev: - Execution of *PagesProject::to_endpoint failed
docs:dev: - Execution of *PagesStructureItem::new failed
docs:dev: - Execution of *FileSystemPath::join failed
docs:dev: - Execution of get_next_package failed
docs:dev: - Next.js package not found] {
docs:dev:   name: 'TurbopackInternalError'
docs:dev: }
docs:dev:  ✓ Compiled /favicon.ico in 0ms

However also notably there is something shown in the browser where as there was nothing returned before (now it shows the generic Internal Server Error page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Module Resolution Module resolution (CJS / ESM, module resolving) Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant