AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Initial GET / Takes 23.3S With Turbopack In Next.Js 16.3.1

On Windows with pnpm, a new Next.js 16.3.1 project using Turbopack dev server takes ~23s to compile Next.js internal modules on first GET /, while app code compiles in 204ms. The bottleneck is Turbopack's on-demand compilation of next.js runtime, exacerbated by pnpm symlink overhead.

highConfidence 65%Next.jsAffected V16.3.1

Origin Analysis

Turbopack lazily compiles the Next.js internal runtime modules on the first request rather than pre-bundling them during server startup. Because the project is installed with pnpm's default isolated node_modules, every import resolution hits a symlink; on Windows, repeated realpath/stat operations for hundreds of internal modules consume 23.1s. The application code itself is tiny, so it compiles in 204ms.
1. pnpm create next-app@latest my-app 2. cd my-app 3. pnpm run dev 4. Open http://localhost:3000 5. Observe first GET / takes 23.3s with next.js: 23.1s.

Fixing Code Block

Edge Case Audit

Hoisted node_modules may cause subtle dependency resolution changes if multiple versions of the same package are required, but the boilerplate app is unaffected. Rollback: delete .npmrc and run pnpm install. If the issue persists, disable Windows Defender real-time scanning for the project directory or switch to npm/yarn. This workaround only improves dev server performance; production builds are unchanged.

Ecosystem Topology