-
Notifications
You must be signed in to change notification settings - Fork 10.3k
aspnet-webpack-react not compatible with react-hot-loader v4 #5178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For users still using react-hot-loader v3, they would be able to use this new version by adding react-hot-loader/patch to their webpack conf manually. No? |
By doing some test, it seems that the module react-hot-loader/webpack has been removed too... const reactHotLoaderWebpackLoader = 'react-hot-loader/webpack'; |
I'm getting the error about |
The safest solution to this might be to check if the
|
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? |
In the migration instructions for migrating from v3 to v4, the only mention of changes to webpack config is the removal of There is also a working example setup for HMR with Typescript that can be referenced: https://github.com/gaearon/react-hot-loader/tree/master/examples/typescript The only notable thing in that sample Webpack config is adding |
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.
If thats the case then @mark-monteiro suggestion of conditionally invoking may just work. Can anyone else confirm this resolves their issue? |
It resolved it for me too. |
When I tested the change it also worked for me as well, but I didn't want to comment on that because I ran through it very briefly and didn't test anything very thoroughly. That being said, is it fair to say that this would be a good change to make regardless of the status of compatibility with v4? It seems like a prudent measure to make sure a package is installed before trying to use it. If we make this change then we maintain backwards compatibility without totally breaking people's builds when they try to update to v4 as is the case now. If there is any further configuration changes required for v4 compatibility, then at least there will be the option to make those Webpack config changes manually. |
Has the change been implemented yet? If not, where would be the proper place to add/call the "npmModuleIsPresent" function? |
Tried @rydergillen-compacSort solution, worked for me too! |
Any updates on this issue? 🙏 |
Since #1562 was resolved. Maybe this issue also could now be fixed? |
any solution doesn't work for me. Would be good to release a new version compatible with react-hot-loader v4 |
@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 updates on this? |
Waiting for #1675 being merged |
Seems like this is now fixed, and is working for me aspnet/JavaScriptServices#1675 (comment) |
Closing as this seems to be resolved now. |
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?
To remove?
react-hot-loader release note
The text was updated successfully, but these errors were encountered: