Skip to content

Conversation

@Pavel-Liteiniy
Copy link

@Pavel-Liteiniy Pavel-Liteiniy commented Jan 7, 2026

Fixes issue: "Webpack: router-code-splitter plugin calls process.exit(0) on done in production, terminating the process prematurely" #5069

Summary by CodeRabbit

  • Bug Fixes
    • Fixed unexpected process termination in the build pipeline, improving deployment stability and allowing builds to complete normally.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

The webpack router plugin's done hook no longer terminates the process after logging completion. Process exit behavior has been removed while the completion logging remains intact, regardless of the build mode.

Changes

Cohort / File(s) Summary
Webpack Router Plugin Behavior
packages/router-plugin/src/core/router-code-splitter-plugin.ts
Removed process termination logic from the done hook; completion messages are now logged without calling process.exit()

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop, a skip, a gentle log,
No abrupt exits through the fog,
The plugin now lets the process stay,
To finish its work a cleaner way!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and clearly describes the main change: removing process.exit from the webpack code-splitter plugin, which directly aligns with the changeset's primary modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddf01dd and 123a4f1.

📒 Files selected for processing (1)
  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
🧠 Learnings (2)
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router

Applied to files:

  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
🔇 Additional comments (1)
packages/router-plugin/src/core/router-code-splitter-plugin.ts (1)

259-261: Critical fix: LGTM!

Removing process.exit(0) from the webpack done hook is correct. Webpack plugins should never terminate the process—calling process.exit() in a lifecycle hook prematurely terminates the build, breaking downstream operations like post-build hooks and cleanup. The done hook merely signals compilation completion; webpack manages the process lifecycle itself. The completion logging remains intact for user feedback.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant