You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Consider adding option to disable HMR error overlay #353
I've added some 3rd party packages that are causing TypeScript compilation errors. As such, the HMR overlay is popping up on every HMR bundle injection. I tried moving those packages to the vendor output bundle (thinking this would prevent them from being recompiled every time I saved one of my own files -- isn't that the point of the vendor bundle???) but the overlay is still displayed every time I save.
Is there a way to suppress the HMR overlay until the 3rd party deps get fixed. The below link describes how to do it but I'm not sure how to translate it into this project (does the HMR config code live in aspnet-webpack-react?)
thinking this would prevent them from being recompiled every time I saved one of my own files
Yes, that is what happens. But if your compiled vendor bundle contains errors, they are still going to show up each time it's loaded.
Is there a way to suppress the HMR overlay until the 3rd party deps get fixed.
Done. I've just published aspnet-webpack version 1.0.17, so upgrade to that. Then you can optionally specify your webpack-hot-middleware/client options manually in webpack.config.js. For example, change your entry config value to this:
... and then you won't get the overlay. You probably only want to do this in development builds (because you don't want HMR in production) so you might want to wrap that part of your config in an if(isDevBuild) { ... } test or similar.
Sounds like HMR is running but has some incompatibility with apollo-client, or maybe Webpack's HMR code is hard-coded not to apply updates if it saw there was an error. I'm afraid this is something you'll have to take up with the apollo-client or Webpack folks :(
Activity
SteveSandersonMS commentedon Oct 4, 2016
Yes, that is what happens. But if your compiled vendor bundle contains errors, they are still going to show up each time it's loaded.
Done. I've just published
aspnet-webpackversion1.0.17, so upgrade to that. Then you can optionally specify yourwebpack-hot-middleware/clientoptions manually inwebpack.config.js. For example, change yourentryconfig value to this:... and then you won't get the overlay. You probably only want to do this in development builds (because you don't want HMR in production) so you might want to wrap that part of your config in an
if(isDevBuild) { ... }test or similar.antmdvs commentedon Oct 4, 2016
Wow, you are quick! Did you already have that one in your back pocket? :)
I'll give it a shot. Thanks, Steve
antmdvs commentedon Oct 4, 2016
Well, it does suppress the overlay, but it still doesn't hot reload my own stuff.
Steps to repro:
yo aspnetcore-spa(ReactRedux)entry: { 'main-client': ['webpack-hot-middleware/client?overlay=false', './ClientApp/boot-client.tsx'] },npm install apollo-client --save'apollo-client'to the end of the 'vendor' array on line 18.webpack --config webpack.config.vendor.jsimport ApolloClient from 'apollo-client';Note that the errors appear in the console (happy), the overlay is suppressed (happy), but the new Counter code doesn't update (sad).
SteveSandersonMS commentedon Oct 5, 2016
Sounds like HMR is running but has some incompatibility with
apollo-client, or maybe Webpack's HMR code is hard-coded not to apply updates if it saw there was an error. I'm afraid this is something you'll have to take up with theapollo-clientor Webpack folks :(