Ignore file watcher change events that omit a changes payload - #1863
Ignore file watcher change events that omit a changes payload#1863Hashim1999164 wants to merge 1 commit into
Conversation
|
We shouldn't be dropping events. This sounds more like a version mismatch issue than a "third party watchers" issue. What's your setup? |
|
The crash in #1767 came from nativewind calling FileMap.emit('change') with no ChangeEvent (react-native-css-interop onChange). I do not have a Metro version mismatch in that stack. DependencyGraph and DeltaCalculator both assume the watcher always sends addedFiles / modifiedFiles / deletedFiles. If dropping a bare change event is the wrong call, I can close this and leave it to nativewind to emit a real payload. Happy to reshape the PR if you would rather Metro treat a missing payload as an empty change set instead of returning early. |
|
Interesting - I didn't realise NativeWind had that level of integration. It looks like this was fixed upstream in nativewind/nativewind#1809 though. |
Fixes #1767
Some third party watchers emit a bare change event with no ChangeEvent payload. DeltaCalculator and DependencyGraph then read changes.addedFiles and throw.
These handlers now return early when the payload is missing, so a bad event does not crash the bundler.
DeltaCalculator tests cover a change emit with no argument and with an empty object.
Changelog: [Fix] Ignore file watcher change events that omit a changes payload