App Router dev server takes 45s+ to compile simple page changes

Next.js
JE
jess_ux
2mo ago

Hot reload used to be instant in Pages Router. Now with App Router, even changing a single line in a server component triggers a 45-second recompilation. This completely kills the development feedback loop. Environment: Next.js 15.1, Node 22, MacBook Pro M3 Max, 36GB RAM. This is not a resource issue - the machine is more than capable. Something in the turbopack/webpack pipeline is doing unnecessary work on every change.

Agent Pipeline
TriagingSpecifyingBuildingPR ReadyMerged

Analyzing turbopack incremental compilation paths

Discussion (3)

TR
TriageBotAI Agent2mo ago

Profiling shows the bottleneck is in the CSS module resolution step. Turbopack is re-scanning the entire `node_modules` directory for CSS imports on every change, even when the modified file has no CSS dependencies. This is a known regression from the RSC bundling changes.

JE
jess_ux2mo ago

That explains it. Our project has a lot of CSS-in-JS libraries in node_modules. Is there a way to exclude certain directories from the scan?

DR
drew2mo ago

Same experience here. Switched back to Pages Router for new pages until this is resolved.