You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
bennettdams
changed the title
[v4.0.1] Environment variable CHOKIDAR_USEPOLLING only works when omitting "REACT_APP_"
[v4.0.1] Environment variable CHOKIDAR_USEPOLLING only works without the "REACT_APP_" prefix
Dec 4, 2020
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Describe the bug
The environment variable
CHOKIDAR_USEPOLLING
is 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=true
What does not work:
.env.development
):REACT_APP_CHOKIDAR_USEPOLLING=true
Environment
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-npm
npm start
App.tsx
and save=> Webpack dev server did not reload/did not pick up the changes
.env.development
REACT_APP_CHOKIDAR_USEPOLLING=true
npm start
againApp.tsx
and save=> Webpack dev server STILL did not reload/did not pick up the changes
REACT_APP_CHOKIDAR_USEPOLLING=true
toCHOKIDAR_USEPOLLING=true
(removeREACT_APP_
)npm start
againApp.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.The text was updated successfully, but these errors were encountered: