Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
Consider this project:
package.json
{
"scripts": {
"start": "webpack --watch src/index.js dist/bundle.js"
},
"devDependencies": {
"webpack": "^3.10.0"
}
}
src/index.js
import x from './x';
alert(x);
src/x.js
export default 42;
Then do this series of steps:
- Run
npm install
. - Run
npm start
. - Delete
src/x.js
. - Create
src/x
folder. - Create
src/x/index.js
with same content assrc/x.js
used to have.
What is the expected behavior?
Webpack recovers from a “not found” error. At the very least after re-saving either src/index.js
or src/x/index.js
.
Actual behavior is that Webpack gets stuck insisting ./x
is not found, and the only way to fix it is by restarting the watcher.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
OS X Sierra, Node 8.9.1 (but it’s an old issue, existed at least since 2016 facebook/create-react-app#1164).
I couldn’t figure out how to correctly set up Webpack beta so I didn’t test that.
Is there any middle ground or a heuristic we could use? For example, if a file is not found, then invalidate any cache entries around it on any FS event.
In webpack 5 it’s not fixed when using multiple aliases #10015