-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Which project does this relate to?
Router
Describe the bug
Summary
The webpack integration of @tanstack/router-plugin’s code-splitter calls process.exit(0) on compiler.hooks.done in production mode. This forcibly ends the Node.js process and can interrupt other plugins’ post-build work (async tasks scheduled in done or afterEmit), and breaks long-running workflows (e.g. production watch).
node_modules/@tanstack/router-plugin/dist/cjs/core/router-code-splitter-plugin.cjs:
if (compiler.options.mode === "production") {
compiler.hooks.done.tap(PLUGIN_NAME, () => {
console.info("✅ " + PLUGIN_NAME + ": code-splitting done!");
setTimeout(() => {
process.exit(0);
});
});
}
Your Example Website or App
none
Steps to Reproduce the Bug or Issue
- Configure webpack in production mode with @tanstack/router-plugin/webpack.
- Add any plugin that performs async work after build completion (e.g. a plugin that schedules a setTimeout, uploads artifacts, or writes additional reports in done/afterEmit).
- Run a production build.
Expected behavior
- Webpack process remains alive until the event loop drains, allowing other plugins’ async post-build tasks to finish.
- If watch is enabled in production, it should keep watching.
Screenshots or Videos
No response
Platform
- Router Version: 1.132.0-alpha.13
- Bundler: Webpack
- Bundler Version: 5.91.0
Additional context
davidgoli
Metadata
Metadata
Assignees
Labels
No labels