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.js project doesn't work with Yarn 4.6.0 using Turbopack #74648

Open
GlittersIsGold opened this issue Jan 8, 2025 · 3 comments
Open

Next.js project doesn't work with Yarn 4.6.0 using Turbopack #74648

GlittersIsGold opened this issue Jan 8, 2025 · 3 comments
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application. Turbopack Related to Turbopack with Next.js.

Comments

@GlittersIsGold
Copy link

Link to the code that reproduces this issue

https://github.com/GlittersIsGold/turboyarnext

To Reproduce

  1. install yarn 4.6.0 - npm install -g yarn@latest

  2. check yarn version - yarn -v should output 4.6.0

  3. init next-app with yarn - yarn create next-app turboyarnext

  4. Follow the prompts, simply answer Yes to use Turbopack

✔ Would you like to use TypeScript? … No / Yes - Y
✔ Would you like to use ESLint? … No / Yes - Y
✔ Would you like to use Tailwind CSS? … No / Yes - N
✔ Would you like your code inside a `src/` directory? … No / Yes - N
✔ Would you like to use App Router? (recommended) … No / Yes - Y
✔ Would you like to use Turbopack for `next dev`? … No / Yes - Y
? Would you like to customize the import alias (`@/*` by default)? › No / Yes - N
Creating a new Next.js app in /Users/GlittersIsGold/Documents/Programms/turboyarnext.

Using yarn.

Initializing project with template: app 

Installing dependencies:
- react
- react-dom
- next

Installing devDependencies:
- typescript
- @types/node
- @types/react
- @types/react-dom
- eslint
- eslint-config-next
- @eslint/eslintrc

! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing [email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager

➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @eslint/eslintrc@npm:3.2.0, @types/node@npm:20.17.12, @types/react-dom@npm:19.0.2, and 319 more.
➤ YN0000: └ Completed in 3s 599ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ sharp@npm:0.33.5 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 361ms
➤ YN0000: · Done with warnings in 5s 185ms
Initialized a git repository.

Success! Created turboyarnext at /Users/GlittersIsGold/Documents/Programm/turboyarnext
  1. proceed to project dir, install deps and try to start app

cd turboyarnext && yarn && yarn dev

➜  turboyarnext git:(main) yarn
➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 272ms

➜  turboyarnext git:(main) yarn dev
   ▲ Next.js 15.1.4 (Turbopack)
   - Local:        http://localhost:3000
   - Network:      http://79.164.27.29:3000

 ✓ Starting...
FATAL: An unexpected Turbopack error occurred. Please report the content of /var/folders/st/_ln0wwtj7xl3pd3l2sv8xh700000gn/T/next-panic-fc976d666c1f252cd743c4aa6d34fee8.log, along with a description of what you were doing when the error occurred, to https://github.com/vercel/next.js/issues/new
[Error [TurbopackInternalError]: Next.js package not found

Debug info:
- Execution of get_entrypoints_with_issues failed
- Execution of Project::entrypoints failed
- Execution of AppProject::routes failed
- Execution of directory_tree_to_entrypoints_internal failed
- Execution of directory_tree_to_loader_tree failed
- Execution of *FileSystemPath::join failed
- Execution of get_next_package failed
- Next.js package not found]
  1. Get an error
cat /var/folders/st/_ln0wwtj7xl3pd3l2sv8xh700000gn/T/next-panic-fc976d666c1f252cd743c4aa6d34fee8.log
---------------------------
Next.js package not found

Debug info:
- Execution of get_entrypoints_with_issues failed
- Execution of Project::entrypoints failed
- Execution of AppProject::routes failed
- Execution of directory_tree_to_entrypoints_internal failed
- Execution of directory_tree_to_loader_tree failed
- Execution of *FileSystemPath::join failed
- Execution of get_next_package failed
- Next.js package not found

Current vs. Expected behavior

Expected to launch Next app via Turbopack & yarn dev, observed to Fatal Turbopack error, package not found.

Next package already exists in package.json

{
  "name": "turboyarnext",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "15.1.4",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.1.4",
    "typescript": "^5"
  },
  "packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 19:02:41 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 12
Binaries:
  Node: 20.14.0
  npm: 10.7.0
  Yarn: 4.6.0
  pnpm: N/A
Relevant Packages:
  next: 15.1.4
  eslint-config-next: 15.1.4
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A

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

create-next-app

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

next dev (local)

Additional context

No response

@GlittersIsGold GlittersIsGold added the bug Issue was opened via the bug report template. label Jan 8, 2025
@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jan 8, 2025
@didix16

This comment has been minimized.

@hamidrezahanafi
Copy link

hamidrezahanafi commented Jan 9, 2025

Will it work if you manually change in package.json that is generated "packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" to "packageManager": "[email protected]"?

@GlittersIsGold
Copy link
Author

Will it work if you manually change in package.json "packageManager": "[email protected]"?

already tried, still not working.

if you change this line to "[email protected]" , you will get an error:

String does not match the pattern of "(npm|pnpm|yarn|bun)@\d+\.\d+\.\d+(-.+)?".

Inserting this line "packageManager": "[email protected]" doesn't make sense, FATAL Turbopack error occurs:

FATAL: An unexpected Turbopack error occurred. Please report the content of /var/folders/st/_ln0wwtj7xl3pd3l2sv8xh700000gn/T/next-panic-1a8855b3640d2770e0b8a87ecdf5640.log, along with a description of what you were doing when the error occurred, to https://github.com/vercel/next.js/issues/new
[Error [TurbopackInternalError]: Next.js package not found

Debug info:
- Execution of get_entrypoints_with_issues failed
- Execution of Project::entrypoints failed
- Execution of AppProject::routes failed
- Execution of directory_tree_to_entrypoints_internal failed
- Execution of directory_tree_to_loader_tree failed
- Execution of *FileSystemPath::join failed
- Execution of get_next_package failed
- Next.js package not found]

I've seen the same issue in berry repo, still no decisions - yarnpkg/berry#6642

There's also no info in documentation

@mischnic mischnic added the Turbopack Related to Turbopack with Next.js. label Jan 10, 2025
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. create-next-app Related to our CLI tool for quickly starting a new Next.js application. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

4 participants