Turbopack does not compile anymore

I’m unable to compile my project with turbopack. It has suddenly stopped working, it just hangs or goes into an infinite loop. It just gets stuck here:

▲ Next.js 15.3.5 (Turbopack)

✓ Starting…
✓ Compiled middleware in 129ms
✓ Ready in 1088ms
○ Compiling /[lang] …

Webpack works perfectly fine, and I can build the project without any issues.
I’ve tried all the suggested troubleshooting steps:

  • Re-installed dependencies, deleted lock files, cache, etc.
  • Upgraded to the latest Next.js (15.3.5)
  • Restarted my Mac
  • Checked my Tailwind config
  • Changed the port (from 3002 to 3005 in this case)

My project is a monorepo and uses the App Router.
There are no errors in the browser console or terminal—Turbopack just hangs at the compile step.

Any ideas on what else I can try, or is this a known issue with Turbopack in monorepos or with certain patterns?

I have the trace-turbopack file if anyone wants to see that.

Thanks for any help!

PS not sure it’s related, but when running with webpack, I get a warning about using next/head but it doesn’t point to a specific file and I cannot find any use of next/head in my project.

Hey! Can you try upgrading to next@canary first to verify if it’s fixed already. Next.js 15.4 is releasing today with a lot of improvements to Turbopack including a few edge cases that caused the compilation to hang.

2 Likes

Doesn’t help at all. Tried both 15.4 and next@canary. Need to downgrade back to 15.3.5 as some of my depencies e.g. @as-integrations/next@3.2.0, @apollo/client-integration-nextjs@0.12.2, ext-auth@4.24.11, next-cloudinary@6.16.0 are pulling that version and there’s no way to get them to use the latest. Can’t use this turbopack anymore, it’s too unreliable.

15.4 is not released yet. What package manager are you using? With e.g. pnpm you can use overrides feature to force all packages to use the specified version: package.json | pnpm

"pnpm": {
    "overrides": {
      "next": "15.4.0-canary.129",
    }
}

Sounds like you were unable to install canary using your package manager and didn’t get around running it?

You can try 15.4 later today when it is released, it’ll likely fix the issue. If not you can send over the .next/trace.log and we can have a look at why it’s hanging (if it wasn’t fixed already you’re likely running into another edge case that wasn’t seen before).

1 Like

I’m using npm@10.9.0. No I did manage to install next 15.4 and the canary but like I said I couldn’t get all the dependencies to use it (even with a resolutions block in my package.json) and turbopack still hangs. How can I send the trace log?

npm has an error built-in that is a bit annoying, however it can be bypassed using --force. I.e. npm install next@canary --force.

The dependencies that you’re listing have a peerdependency on a specific version range of Next.js, that’s why you see that error.

It’s best to give canary a try first, since looking at the 15.3.x trace will likely just highlight that it’s already fixed. Best to verify the very latest changes first.

1 Like

Canary doesn’t change anything:
NEXT_TURBOPACK_TRACING=1 next dev -p 3005 --turbopack

▲ Next.js 15.4.0-canary.129 (Turbopack)

✓ Starting…
✓ Compiled middleware in 106ms
✓ Ready in 1761ms
○ Compiling /[lang] …
GET /privacy/ 200 in 3309ms
It just gets stuck compiling. In fact only one page is able to compile – privacy. The other paths hang. I could just revert to the previous commit when everything was working fine, and slowly re-add my changes, but I’ve done a lot of work since then so that would be super annoying.

Okay great thanks for double checking canary first. If you could grab a trace on that version and share it here, e.g. through google drive or such. Then I can dig into it for you :folded_hands:

Thanks! We’re having a look right away

Thank you. Hopefully we can resolve it.

In order to debug further, would it be possible for you to give me access to the codebase? timneutkens on GitHub.

It seems to be related to the packages/shared/src/lib/graphql/index.ts, it doesn’t finish compiling. If you can’t share access I’d like to see the contents of only that file in order to investigate further.

holy crap, you’re right! I had a duplicate export in there which was causing the issue. No idea how it got there. Now it’s working fine. Thanks a lot for taking a look, I take back what I said about turbopack. Great support!

Awesome, that’s good news.

In order for us to fix this so that Turbopack doesn’t hang for this case could you share exactly what the failing file looks like? Then we can investigate and fix as soon as possible.

I had this:

export * from "./room-queries";
export * from "./price-queries";
export * from "./user-queries";
export * from "./room-queries";
export * from "./reservation-mutations";
export * from "./block-mutations";
export * from "./block-queries";
export * from "./reservation-queries";
export * from "./email-template-queries";
export * from "./contact-queries";
export * from "./contact-mutations";
export * from "./";

I just deleted the export * from “./”; and the duplicate export * from “./room-queries”;

Thank you! Huge help. We were able to create a minimal reproduction and are going to fix, so that even if you have this case it works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.