Skip to content

[Error [TurbopackInternalError]: Next.js package not found #76028

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

Open
Chukwu3meka opened this issue Feb 13, 2025 · 12 comments
Open

[Error [TurbopackInternalError]: Next.js package not found #76028

Chukwu3meka opened this issue Feb 13, 2025 · 12 comments
Labels
linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Comments

@Chukwu3meka
Copy link

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.

Image

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

@github-actions github-actions bot added create-next-app Related to our CLI tool for quickly starting a new Next.js application. Runtime Related to Node.js or Edge Runtime with Next.js. Script (next/script) Related to Next.js Script Optimization. Turbopack Related to Turbopack with Next.js. labels Feb 13, 2025
@harrisrobin
Copy link

harrisrobin commented Feb 13, 2025

Running 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:

---------------------------
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_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

Running npm why, i see the nextjs package is present with the following dependency graph:

npm why output

next@15.1.7
node_modules/next
  peer next@">=15.0.0" from cookies-next@5.1.0
  node_modules/cookies-next
    cookies-next@"^5.0.2" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peerOptional next@">=12.0.0" from inngest@3.31.7
  node_modules/inngest
    inngest@"^3.22.7" from @repo/jobs@0.1.0
    packages/jobs
      @repo/jobs@0.1.0
      node_modules/@repo/jobs
        workspace packages/jobs from the root project
  peer next@">= 14.0.0" from next-safe-action@7.10.3
  node_modules/next-safe-action
    next-safe-action@"^7.9.3" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peer next@"*" from next-themes@1.0.0-beta.0
  node_modules/next-themes
    next-themes@"1.0.0-beta.0" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peerOptional next@">=14.2.0" from nuqs@2.3.2
  node_modules/nuqs
    nuqs@"^2.2.3" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peer next@"^13.0.0 || ^14.0.0 || ^15.0.0" from @inlang/paraglide-next@0.7.9
  node_modules/@inlang/paraglide-next
    @inlang/paraglide-next@"^0.7.2" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peer next@"^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0" from @openpanel/nextjs@1.0.7
  node_modules/@openpanel/nextjs
    @openpanel/nextjs@"^1.0.0" from @repo/analytics@1.0.0
    packages/analytics
      @repo/analytics@1.0.0
      node_modules/@repo/analytics
        @repo/analytics@"*" from web@1.0.0
        apps/web
          web@1.0.0
          node_modules/web
            workspace apps/web from the root project
        workspace packages/analytics from the root project
  peer next@"^13.2.0 || ^14.0 || ^15.0.0-rc.0" from @sentry/nextjs@8.55.0
  node_modules/@sentry/nextjs
    @sentry/nextjs@"^8.54.0" from web@1.0.0
    apps/web
      web@1.0.0
      node_modules/web
        workspace apps/web from the root project
  peerOptional next@"*" from @vercel/flags@2.6.3
  node_modules/@vercel/flags
    @vercel/flags@"^2.6.3" from @repo/kv@1.0.0
    packages/kv
      @repo/kv@1.0.0
      node_modules/@repo/kv
        @repo/kv@"*" from elysiajs@1.0.50
        apps/elysia
          elysiajs@1.0.50
          node_modules/elysiajs
            workspace apps/elysia from the root project
        @repo/kv@"*" from web@1.0.0
        apps/web
          web@1.0.0
          node_modules/web
            workspace apps/web from the root project
        @repo/kv@"*" from @repo/jobs@0.1.0
        packages/jobs
          @repo/jobs@0.1.0
          node_modules/@repo/jobs
            workspace packages/jobs from the root project
        @repo/kv@"*" from @repo/services@0.1.0
        packages/services
          @repo/services@0.1.0
          node_modules/@repo/services
            @repo/services@"*" from web@1.0.0
            apps/web
              web@1.0.0
              node_modules/web
                workspace apps/web from the root project
            @repo/services@"*" from @repo/jobs@0.1.0
            packages/jobs
              @repo/jobs@0.1.0
              node_modules/@repo/jobs
                workspace packages/jobs from the root project
            workspace packages/services from the root project
        workspace packages/kv from the root project
  peerOptional next@">= 13" from @vercel/analytics@1.5.0
  node_modules/@vercel/analytics
    @vercel/analytics@"^1.3.2" from @repo/analytics@1.0.0
    packages/analytics
      @repo/analytics@1.0.0
      node_modules/@repo/analytics
        @repo/analytics@"*" from web@1.0.0
        apps/web
          web@1.0.0
          node_modules/web
            workspace apps/web from the root project
        workspace packages/analytics from the root project
  next@"15.1.7" from web@1.0.0
  apps/web
    web@1.0.0
    node_modules/web
      workspace apps/web from the root project

next@15.1.2 dev
node_modules/react-email/node_modules/next
  next@"15.1.2" from react-email@3.0.7
  node_modules/react-email
    dev react-email@"^3.0.7" from @repo/email@0.1.0
    packages/email
      @repo/email@0.1.0
      node_modules/@repo/email
        workspace packages/email from the root project

EDIT:

15.2.0-canary.57 seems to fix this. But then it breaks my build on Vercel:

web:build: Error: No "exports" main defined in /vercel/path0/node_modules/estree-walker/package.json
web:build: at exportsNotFound (node:internal/modules/esm/resolve:314:10)
web:build: at packageExportsResolve (node:internal/modules/esm/resolve:605:13)
web:build: at resolveExports (node:internal/modules/cjs/loader:638:36)
web:build: at Function._findPath (node:internal/modules/cjs/loader:743:31)
web:build: at Function.<anonymous> (node:internal/modules/cjs/loader:1230:27)
web:build: at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
web:build: at Function._load (node:internal/modules/cjs/loader:1070:27)
web:build: at TracingChannel.traceSync (node:diagnostics_channel:322:14)
web:build: at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
web:build: at Module.<anonymous> (node:internal/modules/cjs/loader:1335:12)

@Chukwu3meka
Copy link
Author

I think the issue has to do with 15.2.0-canary.*.

Try update your package using pnpm or npm => pnpm install next@latest react@latest react-dom@latest

Local dev has been runnin fine since I upgraded the packages

@petrch87
Copy link

Happens to me as well when using turborepo with-tailwind template (https://github.com/vercel/turborepo/tree/main/examples/with-tailwind) with bun. Updated react and nextjs to latest and nothing changed. The difference for me is that I am unable tu run dev script even once.

@samcx samcx removed create-next-app Related to our CLI tool for quickly starting a new Next.js application. Script (next/script) Related to Next.js Script Optimization. Runtime Related to Node.js or Edge Runtime with Next.js. labels Feb 14, 2025
@samcx
Copy link
Member

samcx commented Feb 14, 2025

@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/docs and /app/web).

@Chukwu3meka Can you try updating to the latest canary?

@samcx samcx changed the title Next.js package not found [Error [TurbopackInternalError]: Next.js package not found Feb 14, 2025
@neoromantic
Copy link

I'm on last canary, and i get this:

bun run dev
$ TZ=UTC NODE_OPTIONS=--no-deprecation next dev -p 3001 --experimental-https --turbopack
 ⚠ Self-signed certificates are currently an experimental feature, use with caution.
   Using already generated self signed certificate
   ▲ Next.js 15.2.0-canary.63 (Turbopack)
   - Local:        https://localhost:3001
   - Network:      https://10.33.33.1:3001
   - Environments: .env
   - Experiments (use with caution):
     · ppr
     · staleTimes

 ✓ Starting...
FATAL: An unexpected Turbopack error occurred. Please report the content of /var/folders/c7/2k55r7bn1vz1q7fk6qc5p27c0000gn/T/next-panic-b52778ba6989e8809306d5c794e6fca4.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 get_next_package failed
- Next.js package not found]

I'm using monorepo with latest turborepo, and latest bun.

@harrisrobin
Copy link

I'm on last canary, and i get this:

bun run dev
$ TZ=UTC NODE_OPTIONS=--no-deprecation next dev -p 3001 --experimental-https --turbopack
 ⚠ Self-signed certificates are currently an experimental feature, use with caution.
   Using already generated self signed certificate
   ▲ Next.js 15.2.0-canary.63 (Turbopack)
   - Local:        https://localhost:3001
   - Network:      https://10.33.33.1:3001
   - Environments: .env
   - Experiments (use with caution):
     · ppr
     · staleTimes

 ✓ Starting...
FATAL: An unexpected Turbopack error occurred. Please report the content of /var/folders/c7/2k55r7bn1vz1q7fk6qc5p27c0000gn/T/next-panic-b52778ba6989e8809306d5c794e6fca4.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 get_next_package failed
- Next.js package not found]

I'm using monorepo with latest turborepo, and latest bun.

I was able to solve this by switching to yarn for now. It seems like generating a dummy bun.lockb file should also work. The issue seems to stem from the text based lockfile generated by bun 1.2

@samcx samcx added the linear: turbopack Confirmed issue that is tracked by the Turbopack team. label Feb 18, 2025
@petrch87
Copy link

petrch87 commented Feb 22, 2025

@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/docs and /app/web).

@Chukwu3meka Can you try updating to the latest canary?

Thanks, I can confirm that updating to next js canary version (^15.2.0-canary.69) worked for me.

@Chukwu3meka
Copy link
Author

I can confirm that updating next to 15.2.0-canary.69 fixed this

@wadefletch
Copy link

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.

@Chukwu3meka
Copy link
Author

@wadefletch do you mean lock file for soemthing like pnpm and npm at the sametime in a single project?

@Chukwu3meka
Copy link
Author

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 exist

Image

@CarlosAbundance
Copy link

CarlosAbundance commented Apr 25, 2025

I can confirm that updating next to 15.2.0-canary.69 fixed this

This fixed the issue for me as well. Thank you for posting this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

7 participants