🔧 Fix React Scripts devServer.close compatibility with Node.js v20+#30
Open
Aswinmcw wants to merge 1 commit into
Open
🔧 Fix React Scripts devServer.close compatibility with Node.js v20+#30Aswinmcw wants to merge 1 commit into
Aswinmcw wants to merge 1 commit into
Conversation
Aswinmcw
force-pushed
the
fix/react-scripts-devserver-node-compatibility
branch
from
July 1, 2025 14:01
a742050 to
a97272f
Compare
Aswinmcw
enabled auto-merge (squash)
July 1, 2025 16:16
🚀 Preview Deployment Ready!Your PR has been successfully deployed and is ready for testing: 🌐 Preview LinkFrontend: https://pr-approval-finder-iuxr4jdxg-aswincoders-projects.vercel.app 📊 Deployment Details
🧪 Test Your ChangesYou can now test the PR approval finder with your changes:
📝 Notes
Deployed by GitHub Actions • View Workflow |
Aswin-coder
force-pushed
the
fix/react-scripts-devserver-node-compatibility
branch
from
July 2, 2025 05:01
a97272f to
f6f1837
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem\n\nWhen using Node.js v20+ (including v24) with React Scripts 5.0.1, the development server crashes on shutdown with:\n\n
\nTypeError: devServer.close is not a function\n at process.<anonymous> (/path/to/react-scripts/scripts/start.js:144:19)\n\n\nThis happens because webpack-dev-server v4+ changed the shutdown API, but React Scripts wasn't updated to handle both the old and new methods.\n\n## ✅ Solution\n\nThis PR implements a robust compatibility fix using patch-package:\n\n### 🔧 Changes Made\n\n1. Added patch-package dependency for persistent fixes\n2. Created comprehensive shutdown handler that supports:\n -devServer.close(callback)(webpack-dev-server v3)\n -devServer.stop()(webpack-dev-server v4+)\n - Graceful fallback toprocess.exit()\n3. Added proper error handling with callbacks and promises\n4. Automated patch application via postinstall script\n\n### 📁 Files Changed\n\n-client/package.json- Added patch-package dependency + postinstall script\n-client/patches/react-scripts+5.0.1.patch- Permanent fix for devServer shutdown\n\n### 🧪 Testing\n\n✅ Before: Pressing Ctrl+C crashed with TypeError \n✅ After: Clean shutdown with proper cleanup \n✅ Compatibility: Works with Node.js v18, v20, v22, v24+ \n✅ Persistence: Survives npm installs via patch-package \n\n## 🎯 Impact\n\n- Fixes development workflow interruption\n- Maintains compatibility with all modern Node.js versions\n- Zero breaking changes - transparent fix\n- Persistent solution - won't regress on dependency updates\n\n## �� Related Issues\n\nThis addresses the Node.js v20+ compatibility discussion and ensures smooth development experience for all team members using modern Node.js versions.\n\n---\n\n**Ready for review and testingpush -u origin fix/react-scripts-devserver-node-compatibility* 🚀