Pin Turbopack root to app dir to stop dev recompile loop
Two package-lock.json files exist (parent civi-webform/ + this app); Next 16 silently picked the outer one, so Turbopack watched the parent node_modules/, .claude-flow/, .swarm/, ruvector.db. Background writes in those trees triggered a recompile loop that thrashed .next/dev and leaked memory until the dev server crashed. Setting turbopack.root keeps the watcher scoped to WebForm-mw/.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import path from "node:path";
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,16 @@ const securityHeaders = [
|
||||
const nextConfig: NextConfig = {
|
||||
poweredByHeader: false,
|
||||
reactStrictMode: true,
|
||||
// Pin Turbopack's filesystem root to THIS app's directory. Without this,
|
||||
// Next 16 walks up to the parent civi-webform/ workspace (it sees two
|
||||
// package-lock.json files and silently picks the outer one), which causes
|
||||
// Turbopack to watch the parent node_modules/, .claude-flow/, .swarm/, and
|
||||
// ruvector.db. Background writes in those trees trigger a recompile loop:
|
||||
// compile → write .next/dev → re-trigger → memory blows up. The build-time
|
||||
// warning surfaces the same issue.
|
||||
turbopack: {
|
||||
root: path.resolve(__dirname),
|
||||
},
|
||||
async headers() {
|
||||
return [{ source: "/:path*", headers: securityHeaders }];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user