强制刷新时AngularJS $注入器错误

时间:2017-02-11 16:47:03

标签: angularjs webpack

我正在使用AngularJS 1.6和webpack。

当我在Chrome中强制刷新(Shift + F5)时,我的应用无法启动,我收到以下错误:

app-a1677133c4.js:101030Uncaught TypeError: Cannot read property 'substr' of null
    at app-a1677133c4.js:101030
    at app-a1677133c4.js:101030
    at Object.<anonymous> (app-a1677133c4.js:101030)
    at Object.<anonymous> (app-a1677133c4.js:101031)
    at __webpack_require__ (app-a1677133c4.js:20)
    at app-a1677133c4.js:116
    at Object.<anonymous> (app-a1677133c4.js:289)
    at __webpack_require__ (app-a1677133c4.js:20)
    at Object.<anonymous> (app-a1677133c4.js:47)
    at __webpack_require__ (app-a1677133c4.js:20)
(anonymous) @ app-a1677133c4.js:101030
(anonymous) @ app-a1677133c4.js:101030
(anonymous) @ app-a1677133c4.js:101030
(anonymous) @ app-a1677133c4.js:101031
__webpack_require__ @ app-a1677133c4.js:20
(anonymous) @ app-a1677133c4.js:116
(anonymous) @ app-a1677133c4.js:289
__webpack_require__ @ app-a1677133c4.js:20
(anonymous) @ app-a1677133c4.js:47
__webpack_require__ @ app-a1677133c4.js:20
(anonymous) @ app-a1677133c4.js:40
(anonymous) @ app-a1677133c4.js:43
app-a1677133c4.js:11195 Uncaught Error: [$injector:modulerr] Failed to instantiate module scheduleApp due to:
Error: [$injector:nomod] Module 'scheduleApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.1/$injector/nomod?p0=scheduleApp
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
    at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
    at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
    at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
    at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
    at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
    at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
    at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
    at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
    at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
    at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
    at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
    at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
    at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
    at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15886:16
    at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
    at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
    at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
    at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
    at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
    at angularInit (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12871:6)
    at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:44104:6
    at HTMLDocument.trigger (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:14441:6)

该应用程序名为“scheduleApp” - 无法加载的模块,并在上述错误中被引用。

在第二次正常刷新(ctr + r)时,一切正常。

我不确定如何调试它。有什么想法吗?

更新

原来这是我在Chrome中安装的AdGuard插件。禁用我的网站插件解决了这个问题。

很高兴了解为什么我的应用程序被插件中断的可能原因,例如我的应用内部是否存在违反导致AdGuard的最佳做法的内容将其标记为可疑,或者这可能仅仅是AdGuard的特质。不幸的是,AdGuard没有对此提供任何见解 - 它实际上并未报告任何阻止活动。

0 个答案:

没有答案