aspnetcore: aspnet-webpack-react not compatible with react-hot-loader v4

Hello,

react-hot-loader/patch has been removed from react-hot-loader v4: See documentation here

A new package for aspnet-webpack-react (v4.0.0?), removing support of “reactHotLoaderPatch”, need to be created I suppose.

To remove?

const reactHotLoaderPatch = 'react-hot-loader/patch';

To remove?

        let entryValueArray = entryConfig[entrypointName] as string[];
        if (entryValueArray.indexOf(reactHotLoaderPatch) < 0) {
            entryValueArray.unshift(reactHotLoaderPatch);
        }

react-hot-loader release note

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

@SteveSandersonMS I hate to bug you, but would it be possible to get this PR merged, assuming there is nothing holding it up? We have been waiting a while and it would be nice to be able to upgrade. The proposed solution works for myself and others as described above. Is there anything holding this up?

any solution doesn’t work for me. Would be good to release a new version compatible with react-hot-loader v4

Any updates on this issue? 🙏

Waiting for #1675 being merged

Since #1562 was resolved. Maybe this issue also could now be fixed?

@SteveSanderson

It looks like it would avoid the initial exception, but I’m not sure it solves the issue that HMR wouldn’t work. Do you have an idea about how that should be changed for v4?

I would like to add that by removing the following lines (along with usage of variables) from HotModuleReplacement.ts I was able to successfully use webpack 4 & HMR inside of the ASPNET CORE React/Redux template site.

var reactHotLoaderWebpackLoader = 'react-hot-loader/webpack';
var reactHotLoaderPatch = 'react-hot-loader/patch';

If thats the case then @mark-monteiro suggestion of conditionally invoking may just work. Can anyone else confirm this resolves their issue?

Any updates on this?