Using the create-react-app example:
1) Download the example or clone the repo
2) npm install
3) npm start
npm start throws the following error in Windows 10:
[email protected] start C:\Users\janit\Desktop\create-react-app
SKIP_PREFLIGHT_CHECK=true react-scripts start
'SKIP_PREFLIGHT_CHECK' is not recognized as an internal or external command,
operable program or batch file.
npm starts the react app
Steps:
(On Windows 10)
Using the create-react-app example:
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.4.3 |
| React | v16.9.0 |
| Browser | Chrome |
| TypeScript | No |
| etc. | Windows 10 |
馃憢 Thanks for using Material-UI!
We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.
For support, please check out https://material-ui.com/getting-started/support/. Thanks!
If you have a question on StackOverflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.
Hey @eps1lon this is not a support request, this is a legitimate bug/issue. Package.json changes made 4 months ago here: https://github.com/mui-org/material-ui/blame/f67c2014164267ca9f0603e513deba46f24c47fc/examples/create-react-app/package.json#L6
Causes this to completely not work on Windows machines.
Sorry I missed the part that this was taken from our example. This is indeed an issue (not just for windows but any shell that doesn't support this syntax).
Should use cross-env instead.
Tried cross-env and not working. To clarify, in package.json, instead of having,
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
It should be changed to,
"start": "cross-env=true react-scripts start",
Please advise.
"start": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts start"
"start": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts start"
^ Yes that is the exact fix I ended up using last night. You will need to install cross-env as a dev-dependency.
Could we use the .env support in create-react-app to achieve this without the extra dependency?
Should this env variable be used in the first place?
I'm not sure what the rationale was in adding it so recently.
It was left by mistake in #15219, I think that we should remove it:
diff --git a/examples/create-react-app/package.json b/examples/create-react-app/package.json
index 0b9bffe6a..5db2f0fc6 100644
--- a/examples/create-react-app/package.json
+++ b/examples/create-react-app/package.json
@@ -3,7 +3,7 @@
"version": "4.0.0",
"private": true,
"scripts": {
- "start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
+ "start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Most helpful comment
"start": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts start"