Describe the bug
The environment variable CHOKIDAR_USEPOLLING is ignored in .env* files when using the REACT_APP_ prefix.
When using it without REACT_APP_, it is working fine.
I have a development setup inside a Docker container (Debian) with VS Code, so for Webpack to pick up changes, I need to use CHOKIDAR_USEPOLLING=true. Without that environment variable, changes in the code are ignored by Webpack.
What works:
- in
package.json: { ... "start": "CHOKIDAR_USEPOLLING=true react-scripts start" ... }
- in any dotenv file (like
.env.development): CHOKIDAR_USEPOLLING=true
What does not work:
- in any dotenv file (like
.env.development): REACT_APP_CHOKIDAR_USEPOLLING=true
Environment
System:
OS: Windows 10 10.0.19041
Node: v14.15.1
NPM: 6.14.8
VS Code: 1.51.1
npmPackages:
react: ^17.0.1 => 17.0.1
react-dom: ^17.0.1 => 17.0.1
react-scripts: 4.0.1 => 4.0.1
Steps to reproduce
Disclaimer: I'm not sure whether this happens also without VS Code & Remote Containers.
- Open a folder in a VS Code Remote Container
npx create-react-app my-app --template typescript --use-npm
npm start
- Make changes in
App.tsx and save
=> Webpack dev server did not reload/did not pick up the changes
- Create
.env.development
- Add
REACT_APP_CHOKIDAR_USEPOLLING=true
- Kill process and do
npm start again
- Make changes in
App.tsx and save
=> Webpack dev server STILL did not reload/did not pick up the changes
- Change
REACT_APP_CHOKIDAR_USEPOLLING=true to CHOKIDAR_USEPOLLING=true (remove REACT_APP_)
- Kill process and do
npm start again
- Make changes in
App.tsx and save
=> Webpack finally picks up the changes
Expected behavior
I would expect the env variable REACT_APP_CHOKIDAR_USEPOLLING to work.
Actual behavior
..but it only works without the REACT_APP_ prefix.
Describe the bug
The environment variable
CHOKIDAR_USEPOLLINGis ignored in.env*files when using theREACT_APP_prefix.When using it without
REACT_APP_, it is working fine.I have a development setup inside a Docker container (Debian) with VS Code, so for Webpack to pick up changes, I need to use
CHOKIDAR_USEPOLLING=true. Without that environment variable, changes in the code are ignored by Webpack.What works:
package.json:{ ... "start": "CHOKIDAR_USEPOLLING=true react-scripts start" ... }.env.development):CHOKIDAR_USEPOLLING=trueWhat does not work:
.env.development):REACT_APP_CHOKIDAR_USEPOLLING=trueEnvironment
Steps to reproduce
Disclaimer: I'm not sure whether this happens also without VS Code & Remote Containers.
npx create-react-app my-app --template typescript --use-npmnpm startApp.tsxand save=> Webpack dev server did not reload/did not pick up the changes
.env.developmentREACT_APP_CHOKIDAR_USEPOLLING=truenpm startagainApp.tsxand save=> Webpack dev server STILL did not reload/did not pick up the changes
REACT_APP_CHOKIDAR_USEPOLLING=truetoCHOKIDAR_USEPOLLING=true(removeREACT_APP_)npm startagainApp.tsxand save=> Webpack finally picks up the changes
Expected behavior
I would expect the env variable
REACT_APP_CHOKIDAR_USEPOLLINGto work.Actual behavior
..but it only works without the
REACT_APP_prefix.