-
Notifications
You must be signed in to change notification settings - Fork 518
HMR no longer working when upgraded to latest version #725
Comments
I believe there's something wrong with the Templates, can you install the template with the generator instead?
|
I have the same problem from the generator. |
Thanks @MarkPieszak . You are right. I am using very very old template version in VS2015 Template Pack which is with angular 2.0.0. I didn't know that I can get the latest template in this way. Whenever I create a new project, I use VS2015 >> New Project >> Angular 2 Template SPA >> Create procedures. I downloaded the latest template as instructed, created a new project, compared the files and finally, HMR is working now. I just need to copy the following block in boot-client.js and all sorted.
|
@MarkPieszak May I ask some questions regarding with this Template?
As a beginner to ng2, I used this template to start my ng2 journey. I didn't know that latest version of template is out and how to get it. There will be many newbies like me who wants to learn ng2 and thought that it's the best template to use and learn.
May I know where that file is referenced? I couldn't find it anywhere in the code. In the old template, we didn't have that server/vendor.js file. It used to be generated only in wwwroot. Thanks for your help. |
I'm not sure exactly but I believe to update those it's not as easy as win a generator. @SteveSandersonMS does all the publishing he could help give a better answer about the Pack templates. They come from webpack.config.vendor.js file, there's 2 bundle configurations there as well. |
Pretty much, yes. We are likely to deprecate and remove that template soon, in favour of shipping via |
Firstly, this project is based on famous .Net Core and ng2 template for Visual Studio 2015 Link to VS 2015 Template Tutorial
The problem started when I decided to upgrade all libraries to latest version (@angular:^2.4.8 and WebPack:^2.2.1). I got so many errors coz of major breaking changes in this upgrade journey. I managed to sort out almost all and got the app up and running as usual except this final issue.
It doesn't load the changes anymore by using HotModuleReplacement (HMR). All the changes reflect on the page, when I refresh (F5) on the browser. It just stops automatic updating.
We can see here that it does know the changes, compiled and returned the latest (correct) html codes, but it couldn't load it back on the page.
I have double checked that the new file is generated for 'dist/main-client.js' and it is re-generated every time I change something in html/ts file. However, it keeps saying that Selector 'app' did not match any elements.
webpack.config.vendor.js
I have included aspnet-prerendering in the vendor entry.
webpack.config.js
boot-server.ts
Could you guys please help me to make it work again? Everything except this feature is missing after the upgrade.
The text was updated successfully, but these errors were encountered: