-
Couldn't load subscription status.
- Fork 3
Fix npm start for react examples
#45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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