Skip to content

Commit f5b79fd

Browse files
Martín Bigiograbbou
authored andcommitted
Reset hasError flag after HMR request
Summary: This got broken recently. As a result of this, when a module throws while being required, either by regular load or hot reload, the module object is marked as `hasError`. Form that point all subsequent HMR updates will fail because it will think the module failed while executing the factory but the failure could have been on an old run of an old factory. The fix is very simple: just reset `hasError` to false when accepting a module. Closes #7567 Differential Revision: D3310685 fbshipit-source-id: 2f0b48ab7432b7c221d0c88a019a28969a8862b2
1 parent 9cc5cf5 commit f5b79fd

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • packager/react-packager/src/Resolver/polyfills

packager/react-packager/src/Resolver/polyfills/require.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ if (__DEV__) {
179179
if (factory) {
180180
mod.factory = factory;
181181
}
182+
mod.hasError = false;
182183
mod.isInitialized = false;
183184
require(id);
184185

0 commit comments

Comments
 (0)