{"record":{"id":"5556c2a4feceb494","repo":"vercel/next.js","slug":"found-a-change-in-path-basename-filename-rest","errorCode":null,"errorMessage":"Found a change in ${path.basename(filename)}. Restarting the server to apply the changes...","messagePattern":"Found a change in (.+?)\\. Restarting the server to apply the changes\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/lib/start-server.ts","lineNumber":592,"sourceCode":"        break\n      }\n      dirWatchPaths.push(nextAncestor)\n      prevAncestor = nextAncestor\n    }\n\n    const configFiles = CONFIG_FILES.map((file) => path.join(dir, file))\n    const Watchpack =\n      require('next/dist/compiled/watchpack') as typeof import('next/dist/compiled/watchpack').default\n    const wp = new Watchpack()\n    wp.watch({\n      files: configFiles,\n      missing: dirWatchPaths,\n    })\n    wp.on('change', async (filename) => {\n      if (!configFiles.includes(filename)) {\n        return\n      }\n      Log.warn(\n        `Found a change in ${path.basename(\n          filename\n        )}. Restarting the server to apply the changes...`\n      )\n      process.exit(RESTART_EXIT_CODE)\n    })\n    wp.on('remove', (removedPath: string) => {\n      if (dirWatchPaths.includes(removedPath)) {\n        Log.error(\n          `The directory at \"${removedPath}\" was deleted.\\n\\n` +\n            'Deleting this directory while Next.js is running can lead to ' +\n            'undefined behavior. Restarting the server to recover...'\n        )\n        process.exit(RESTART_EXIT_CODE)\n      }\n    })\n  }\n","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/server/lib/start-server.ts#L574-L610","documentation":"Warning from the dev server's Watchpack file watcher in startServer: it watches next.config.js and related CONFIG_FILES, and when one of them changes on disk the running server cannot apply the new configuration in place. It therefore logs this warning and restarts the dev server so the new config is picked up.","triggerScenarios":"Thrown at packages/next/src/server/lib/start-server.ts:592 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; the server restarted to apply the config change."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89d017eac43ebf4742ed2b58d3c1373b70283b69","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}