Replies: 1 comment
-
|
You’re hitting this because
Those were removed in So when you force an override to
Why the override failsEven though So this is not just a version mismatch — it’s a breaking API incompatibility between CRA 5 and Realistic options1. Stay on CRA 5 + WDS 4 for nowThis is the simplest path if you need the app running without reworking the build setup. But to be clear: this does not fix the CVE. It just avoids the compatibility break caused by forcing WDS 5. Since this issue affects the development server, not the production build, some teams choose to accept or mitigate the risk depending on how their dev environment is exposed. 2. Patch CRA’s dev-server config (advanced)If you absolutely must use That usually means one of these:
At minimum, you would need to:
Example with CRACO: module.exports = {
devServer: (devServerConfig) => {
delete devServerConfig.onBeforeSetupMiddleware;
delete devServerConfig.onAfterSetupMiddleware;
devServerConfig.setupMiddlewares = (middlewares, devServer) => {
return middlewares;
};
return devServerConfig;
},
};That said, this may not be enough on its own. CRA 5 was not designed for WDS 5, so additional incompatibilities may appear. 3. Migrate away from CRA (best long-term option)Long term, this is probably the cleanest solution.
If keeping up with security fixes matters, it’s worth considering a move to:
Bottom line
Your practical choices are:
So yes: the error you’re seeing is expected when forcing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using react-scripts@5.0.1, which is locked to webpack-dev-server@4.x.
A vulnerability was found: CVE-2025-30360
While webpack5.2.1 fixes the CVE (using override), the upgrade doesn't let me run the app. I get this error on npm start:
Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
options has an unknown property 'onAfterSetupMiddleware'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, ipc?, liveReload?, onListening?, open?, port?, proxy?, server?, app?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
any solutions?
Beta Was this translation helpful? Give feedback.
All reactions