Open mischnic opened 3 years ago
I have the same problem.
The bad part is that this will stop the bundling process until I remove .parcel-cache
and restart the parcel process and until then, it will keep failing saying that it can't find some non existent file. (In my case, it complains it can't find *.js
when I'm only specifying *.styl
in the glob resolver.)
It works fine when adding a new file, but deleting the file needs manual intervention to fix the parcel process.
This is most likely due to an incorrect cache validation in part of parcel's glob. I'm not sure if it's a limitation of parcel's invalidation, but in order for it to work, it needs to watch every possible globbed file by listening to the parent directory.
Same issue when removing a file: Error: ENOENT: no such file or directory, open '.../src/*.js'
.
I use it to watch and automatically reload assets in my visual novel engine, and this issue really annoys me. Any workarounds so far?..
🐛 bug report
When removing a file matched by
@parcel/resolver-glob
, an error occurs:*After applying the workaround in https://github.com/parcel-bundler/parcel/issues/6874, otherwise you get `ENOENT: no such file or directory, open '/Users/niklas/Desktop/x/x.js'`**
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
No error, rebuild without that file.
😯 Current Behavior
See error above.
💁 Possible Solution
I think this happens because the request to rerun the transformer is invalidated before the resolver is rerun.
💻 Code Sample
x1.js:
x2.js:
yarn parcel build index.js
. Builds as expected (with two files matched by the glob)x2.js
yarn parcel build index.js
, the error occurs.🔦 Context
This happened for me when writing a custom resolver, so this needs to be fixed in core.
🌍 Your Environment