【发布时间】:2015-11-16 20:26:57
【问题描述】:
我有一个从一开始就不是我的项目,整个部署是不完整的。我有可怕的咕噜声,忽略了指定here 的覆盖,现在我发现当他生成具有所有依赖项的 vendor.js 时,它根本不起作用。浏览器打印:
Uncaught TypeError: Cannot read property 'Item' of undefined(anonymous function) @ vendor.js:14(anonymous function) @ vendor.js:14
vendor.js:4 Uncaught Error: [$injector:nomod] Module 'gettext' 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.2.14/$injector/nomod?p0=gettext(anonymous function) @ vendor.js:4(anonymous function) @ vendor.js:4b @ vendor.js:4l.bootstrap @ vendor.js:4(anonymous function) @ scripts.js:1
VM47 vendor.js:4 Uncaught Error: [$injector:modulerr] Failed to instantiate module trepeatApp due to:
Error: [$injector:modulerr] Failed to instantiate module angularPayments due to:
Error: [$injector:nomod] Module 'angularPayments' 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.
当我只使用 grunt serve 任务时,它可以正常工作,但如果我 grunt build 在下面这些任务中的某些东西只会破坏该死的脚本
'concat',
'ngmin',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'usemin',
'htmlmin',
有人可以帮助我吗?我越来越绝望了
[更新 - 2015 年 8 月 24 日]
我已经阅读了@RobSchmuecker 评论的链接并更改了gettext 配置上的一些内容,其中一个错误已解决。
Uncaught Error: [$injector:modulerr] Failed to instantiate module trepeatApp due to:
Error: [$injector:modulerr] Failed to instantiate module angularPayments due to:
Error: [$injector:nomod] Module 'angularPayments' 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.4.4/$injector/nomod?p0=angularPayments
at http://mylocaldev.com:3000/scripts/vendor.js:4:15152
at http://mylocaldev.com:3000/scripts/vendor.js:4:24650
at b (http://mylocaldev.com:3000/scripts/vendor.js:4:24123)
at http://mylocaldev.com:3000/scripts/vendor.js:4:24435
at http://mylocaldev.com:3000/scripts/vendor.js:5:1222
at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559)
at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000)
at http://mylocaldev.com:3000/scripts/vendor.js:5:1169
at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559)
at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000)
http://errors.angularjs.org/1.4.4/$injector/modulerr?p0=angularPayments&p1=…20n%20(http%3A%2F%2Fmylocaldev.com%3A3000%2Fscripts%2Fvendor.js%3A5%3A1000)
at http://mylocaldev.com:3000/scripts/vendor.js:4:15152
at http://mylocaldev.com:3000/scripts/vendor.js:5:1428
at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559)
at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000)
at http://mylocaldev.com:3000/scripts/vendor.js:5:1169
at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559)
at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000)
at $a (http://mylocaldev.com:3000/scripts/vendor.js:5:2690)
at h (http://mylocaldev.com:3000/scripts/vendor.js:4:22195)
at ga (http://mylocaldev.com:3000/scripts/vendor.js:4:22505)
http://errors.angularjs.org/1.4.4/$injector/modulerr?p0=trepeatApp&p1=Error…ga%20(http%3A%2F%2Fmylocaldev.com%3A3000%2Fscripts%2Fvendor.js%3A4%3A22505)
【问题讨论】:
-
它会为您提供错误详细信息,因此请检查
Item和gettext的使用情况,它们是如何注入的,缩小是否安全等。 -
您可能没有正确定义和注入
angularPayments模块以允许压缩程序正确引用它。看看这里docs.angularjs.org/guide/di -
我已经知道是什么导致了
Item,咕噜忽略了指定的覆盖,就像我在问题@dfsq 上所说的那样 -
我将检查该链接@RobSchmuecker。谢谢
标签: javascript ruby-on-rails angularjs node.js gruntjs