Fix npm start for react examples#45
Conversation
miguelcalderon
left a comment
There was a problem hiding this comment.
Downgrading Webpack Dev Server will reintroduce several vulnerabilities. Can you try other solutions, like https://discuss.codecademy.com/t/react-app-error/779264/2, please?
We should eventually just remove the CRA example, this framework has long been abandoned.
498ebe2 to
4ee146f
Compare
4ee146f to
60876fa
Compare
|
@miguelcalderon got it! I've fixed it using an AI-generated patch for the |
miguelcalderon
left a comment
There was a problem hiding this comment.
We may have a more standardized approach to achieve the same result, sorry not suggesting this before! 🙈
|
|
||
| patchWebpackDevServerConfig(); | ||
|
|
||
| require("react-scripts/scripts/start"); |
There was a problem hiding this comment.
@vladimir-tikhonov-nutrient we use patch-package in the monorepo to solve similar issues; do you think we could use it here as well?
|
I agree with Miguel, CRA is abandoned so I'm not sure if it'll receive all security updates. Perhaps we should just remove this example and default to vite which is recommended over CRA. |
Running
npm i && npm startwithinexamples/reactresulted in the following error: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'Seems like
webpack-dev-server@5is not compatible withreact-scripts@5, so I've downgraded it and now everything works