Redux react webpack's hot module reload actions show warning, webpack stuck at errors

I want to use webpack HMR to reload redux reducers and auto reload when modifying or adding new actions; However it show the warning, when after I edit action files.

[HMR] unexpected require(811) from disposed module 76

And when these have errors in action file Webpack HMR stuck at the following logs, how can I config webpack to ignore these errors?

[WDS] App updated. Recompiling…

[WDS] App hot update…

Code I’ve used:

if(module.hot){
    module.hot.accept(); // accepts any JS file change.
    module.hot.addStatusHandler(function(status){
        if(status === "idle"){
            const {appStore} = require('./appStore');
            store.replaceReducer(appStore); // reload reducers
        }
    });
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注