本文介绍了有角度的. [HMR]无法应用更新.需要完全重装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要添加HMR(故事配置hmr )添加到我的Angular项目中,但我却进行了热重载,而我将其完全重载.

已更新为8号角,问题仍未解决.

[HMR] Cannot apply update. Need to do a full reload!
...
[HMR] Error: Aborted because ./node_modules/raw-loader/index.js!./src/app/components/tabs/remark/remark.component.html is not accepted
Update propagation: ./node_modules/raw-loader/index.js!./src/app/components/tabs/remark/remark.component.html -> ./src/app/components/tabs/remark/remark.component.ts -> ./src/app/app.module.ts -> ./src/main.ts -> 0
    at hotApply (http://localhost:4201/runtime.js:525:30)
    at http://localhost:4201/runtime.js:363:22
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:4201/polyfills.js:3516:26)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:4201/polyfills.js:3275:43)
    at http://localhost:4201/polyfills.js:4035:34
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:4201/polyfills.js:3548:31)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:4201/polyfills.js:3320:47)
    at drainMicroTaskQueue (http://localhost:4201/polyfills.js:3726:35)
  1. 列表项
解决方案

我以前经常像这样运行我的应用ng serve --hmr

一旦我开始使用hmr配置ng serve -c hmr

HMR开始工作.

您应确保在angular.jsonenvironment.ts

中启用了hmr

I'm add HMR (stories configure hmr) to my Angular project, but instead hot reloading i'm getting it full reload.

Updated to angular 8, the problem is not solved.

[HMR] Cannot apply update. Need to do a full reload!
...
[HMR] Error: Aborted because ./node_modules/raw-loader/index.js!./src/app/components/tabs/remark/remark.component.html is not accepted
Update propagation: ./node_modules/raw-loader/index.js!./src/app/components/tabs/remark/remark.component.html -> ./src/app/components/tabs/remark/remark.component.ts -> ./src/app/app.module.ts -> ./src/main.ts -> 0
    at hotApply (http://localhost:4201/runtime.js:525:30)
    at http://localhost:4201/runtime.js:363:22
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:4201/polyfills.js:3516:26)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:4201/polyfills.js:3275:43)
    at http://localhost:4201/polyfills.js:4035:34
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:4201/polyfills.js:3548:31)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:4201/polyfills.js:3320:47)
    at drainMicroTaskQueue (http://localhost:4201/polyfills.js:3726:35)
  1. List item
解决方案

I used to run my app like thatng serve --hmr

Once I started using hmr configurationng serve -c hmr

HMR started working.

You should ensure you have hmr enabled in angular.json and environment.ts

这篇关于有角度的. [HMR]无法应用更新.需要完全重装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 10:29