webpack / watchpack

Wrapper library for directory and file watching.
MIT License
377 stars 105 forks source link

Implement fix for Fast Refresh bug #229

Open JonnyBurger opened 1 year ago

JonnyBurger commented 1 year ago

Fixes the bug described in https://github.com/webpack/watchpack/issues/228.

Verified by checking that the example posted in the original issue works now, null is not returned, and by adding a test that failed before the fix.

JonnyBurger commented 1 year ago

Just noticed that a test is failing and am a bit lost on how this could be correctly fixed..

There is a test that asserts that getTimeInfoEntries should not have files with invalid names in their map. However Webpack relies on it here:

https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/FileSystemInfo.js#L2102-L2105

In this code snippet, getting the file timestamps for a file with wrong casing returns null, which is neither undefined nor ignore and therefore the module does not get invalidated. Maybe this should be fixed on Webpack side instead?

Need some help in figuring out what the right way to approach it is, until then I need to pause on this issue.