next.js: [Error [TurbopackInternalError]: Next.js package not found
Link to the code that reproduces this issue
https://github.com/Chukwu3meka/waverd-client/tree/Chukwu3meka
To Reproduce
After upgrading to canary and migrating from tailwind3 to v4. Next runs fine but after sometime it crashes without making any change to the codebase.
Next version is next": "15.2.0-canary.56 but next info return:
next: 15.1.2 // There is a newer version (15.1.7) available, upgrade recommended!
Error I get is
FATAL: An unexpected Turbopack error occurred. Please report the content of C:\Users\CHUKWU~1\AppData\Local\Temp\next-panic-9a86b6afcb30f9175043498a85323cb4.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_operation failed
- Execution of EntrypointsOperation::new 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 get_next_package failed
- Next.js package not found]
The batch file cannot be found.
Current vs. Expected behavior
This is my package.json and I use pnpm as my package manager.
{
"name": "waverd-client",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@next/bundle-analyzer": "^15.1.7",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-navigation-menu": "^1.2.5",
"@radix-ui/react-separator": "^1.1.2",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.3",
"@reduxjs/toolkit": "^2.5.1",
"@vercel/analytics": "^1.5.0",
"@vercel/speed-insights": "^1.2.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.475.0",
"next": "15.2.0-canary.56",
"next-themes": "^0.4.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-icons": "^5.4.0",
"react-redux": "^9.2.0",
"tailwind-merge": "^3.0.1",
"tailwindcss-animate": "^1.0.7",
"vaul": "^1.1.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"sass": "^1.84.0",
"tailwindcss": "^4",
"typescript": "^5"
}
}
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 16142
Available CPU cores: 12
Binaries:
Node: 22.12.0
npm: 10.9.0
Yarn: N/A
pnpm: 9.15.2
Relevant Packages:
next: 15.1.2 // There is a newer version (15.1.7) available, upgrade recommended!
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: N/A
Next.js Config:
output: N/A
⚠ There is a newer version (15.1.7) available, upgrade recommended!
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)
Turbopack, Runtime, create-next-app, Script (next/script)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (3 by maintainers)
For anyone coming through later, this can also be caused by having an unnecessary additional lock file in the package directory, rather than at the monorepo root.
Just noticed this same issue on my main app (not canary) after updating to
"next": "15.2.1"from"next": "15.2.0"when I try to import a file that does not existRunning into this as well on next 15.1.7 when I recently switched to bun v1.2 in my monorepo, with the biggest difference being that I am now using Bun’s text based lockfile instead of binary. Ever since that change, nextjs no longer runs for me.
Here’s the contents of the panic log:
Running npm why, i see the nextjs package is present with the following dependency graph:
npm why output
EDIT:
15.2.0-canary.57 seems to fix this. But then it breaks my build on Vercel:
Thanks for reporting. This error usually happens when Turbopack determined your project’s root directory based on a lockfile that exists further down the filesystem than where next is installed.
For example, something like this:
Here, Turbopack determined the root directory to be
my-app, but Next.js is installed further up the tree.You’ll need to either:
my-appif possible, orturbopack.rootin tonext.config.jsto your repository’s root directory (or wherever Next.js is installed), as described hereWe’re working on a better way of communicating this problem, and exploring other approaches where the root directory can be better discovered automatically.
I’m encountering the same issue on the latest version of Next.js (15.3.2) with turborepo
Thanks, I can confirm that updating to next js canary version (^15.2.0-canary.69) worked for me.
@Chukwu3meka Thank you for submitting an issue!
@petrch87 I was able to replicate with the latest but it looks like it is fixed with the latest canary. I had to update next to the latest canary on both Next.js apps (
/app/docsand/app/web).@Chukwu3meka Can you try updating to the latest canary?