fix(vite): kill prerender child process when the vite preview server closes#3907
fix(vite): kill prerender child process when the vite preview server closes#3907
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughCentralizes preview subprocess termination in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/build/vite/preview.ts (1)
89-95: LGTM! Signal handlers correctly use the new killChild helper.The refactor improves code consistency by centralizing child process termination logic.
Optional: Consider
process.exit(0)for explicit success code.🔎 Optional: Make exit code explicit
process.once(sig, () => { consola.info(`Stopping preview server...`); killChild(sig); - process.exit(); + process.exit(0); });
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/build/vite/preview.ts
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{ts,js,tsx,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,js,tsx,jsx}: Usepathefor cross-platform path operations instead of Node.jsnode:path
Use ESM and modern JavaScript
Do not add comments explaining what the line does unless prompted
Files:
src/build/vite/preview.ts
src/{build,dev,runner,cli}/**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use
consolafor logging in build/dev code; usenitro.loggerwhen available
Files:
src/build/vite/preview.ts
src/**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use
unstoragefor storage abstraction
Files:
src/build/vite/preview.ts
src/build/**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Virtual modules must be registered in
src/build/virtual.ts
Files:
src/build/vite/preview.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: tests-rollup (windows-latest)
- GitHub Check: tests-rolldown (windows-latest)
- GitHub Check: tests-rollup (ubuntu-latest)
🔇 Additional comments (2)
src/build/vite/preview.ts (2)
83-87: LGTM! Good abstraction for child process cleanup.The
killChildhelper centralizes termination logic and includes a defensive check against killing an already-terminated process.
97-99: No changes needed. According to Vite's type definitions,PreviewServer.httpServeris typed ashttp.Server(non-nullable), nothttp.Server | nullas stated in the review. The code is safe as written and will not throw a runtime error. TheconfigurePreviewServerhook is invoked after the server is created and listening, sohttpServeris guaranteed to be present.Likely an incorrect or invalid review comment.
No description provided.