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 troubleshooting documentation mentions the usage of CHOKIDAR_USEPOLLING=true in case webpack watcher doesn't detect files changes. The latest webpack version (5.72.1) doesn't use chokidar to detect source file changes. It uses its own package watchpack that doesn't support CHOKIDAR_USEPOLLING variable. It has WATCHPACK_POLLING variable for it.
Did you try recovering your dependencies?
Yep, it doesn't change the dependency tree (create-react-app => react-scripts => webpack => watchpack).
Which terms did you search for in User Guide?
N/A
Environment
N/A
Steps to reproduce
N/A
Expected behavior
Updated documentation that mentions WATCHPACK_POLLING in case of troubles with webpack watcher. I'm not sure that CHOKIDAR_USEPOLLING is completely outdated. I found chokidar usage in webpack-dev-server to track public files so I assume they aren't fully migrated from chokidar.
Actual behavior
Setting CHOKIDAR_USEPOLLING variable isn't enough to enforce polling of webpack watcher.
Reproducible demo
I got the problem with webpack watcher during using NFS. Apparently, inotify that fires events on file updates doesn't work with NFS. I couldn't create simple steps to reproduce the issue.
Can confirm, as of 2023-06-11 using the latest create-react-app script to init the project, setting WATCHPACK_POLLING=true by some means (direct environment export, .env, whatever) gets the npm start invocation working as expected
For anyone else coming into this, I also recommend setting in the react-scripts/config/webpack.config.js module.exports to include the object
Activity
S-C-Johnston commentedon Jun 20, 2023
@dimitriylol thank you!
Can confirm, as of 2023-06-11 using the latest create-react-app script to init the project, setting
WATCHPACK_POLLING=trueby some means (direct environment export, .env, whatever) gets thenpm startinvocation working as expectedFor anyone else coming into this, I also recommend setting in the react-scripts/config/webpack.config.js module.exports to include the object
so that polling doesn't hammer your cpu with a bunch of files that are not going to change. (https://webpack.js.org/configuration/watch/#watchoptionsignored)