角MINERR_ASSET未找到404 [英] angular MINERR_ASSET not found 404
问题描述
我越来越登录到控制台的错误:
GET HTTP://本地主机:3000 / JS / lib目录/角/ MINERR_ASSET 404(未找到)
我看到这个帖子,它说这不是inculding ngRoute模块的结果,但我做的!
公共/ JS / app.js:
window.app = angular.module('均值 - 博客种子',['ngCookies','ngResource','ui.bootstrap','ngRoute','均值博客-seed.controllers','mean-blog-seed.services']);
然后,我有一个玉文件引用角route.js:
脚本(类型='文字/ JavaScript的'SRC ='JS / lib目录/角/ angular.min.js')
脚本(类型='文字/ JavaScript的'SRC ='JS / lib目录/角路由/角route.min.js')
脚本(类型='文字/ JavaScript的'SRC ='JS / lib目录/角饼干/角cookies.min.js')
脚本(类型='文字/ JavaScript的'SRC ='JS / lib目录/角资源/角resource.min.js')
脚本(类型='文字/ JavaScript的'SRC ='JS / lib目录/角引导/ UI的引导-tpls.min.js')脚本(SRC ='JS / app.js)
脚本(SRC ='JS / config.js)
脚本(SRC ='JS /服务/ global.js)
脚本(SRC ='JS /控制器/ posts.js')
脚本(SRC ='JS /控制器/ header.js')
脚本(SRC ='JS / filters.js')
脚本(SRC ='JS / directives.js')
回购是这里
更新:
我张贴在GitHub上的问题,并得到了参考这个疯狂的答案:<一href=\"https://github.com/angular/angular.js/issues/4675\">https://github.com/angular/angular.js/issues/4675
在NG-封亚军运行编译过程的角度具体通
这增加了对MINERR_ASSET一个定义,即不包括资产
与任何的1.2.x版本(唯一的释放与源地图)的。
然而,源映射的引用MINERR_ASSET作为源和作为
结果有404请求的文件时。
我只快速扫了一眼繁重的任务,也
NG-封亚军,但我的IM pression这是有可能的下
NG-封亚军包括minErr.js或某些文件生成基于
它。无论哪种方式正确资产应与其他包装
源文件或MINERR_ASSET应该从源映射中移除
消息人士。
块引用>解决方案最近我注意到,在Safari我得到了同样的错误。
源:angular.js,MINERR_ASSET]
到
源:angular.js]
和增加与缩小的版本,以固定控制台错误相关angularjs文件非minified的版本。如果您正在使用angularjs,应精缩版量产版,确保您添加与库文件相关的地图,或者你可能有多余的服务器错误。
I'm getting an error logged to the console:
GET http://localhost:3000/js/lib/angular/MINERR_ASSET 404 (Not Found)
I saw this post and it said it was a result of not inculding ngRoute module, but I do!
public/js/app.js:
window.app = angular.module('mean-blog-seed', ['ngCookies', 'ngResource', 'ui.bootstrap', 'ngRoute', 'mean-blog-seed.controllers', 'mean-blog-seed.services']);
Then I have a jade file that references angular-route.js:
script(type='text/javascript', src='js/lib/angular/angular.min.js') script(type='text/javascript', src='js/lib/angular-route/angular-route.min.js') script(type='text/javascript', src='js/lib/angular-cookies/angular-cookies.min.js') script(type='text/javascript', src='js/lib/angular-resource/angular-resource.min.js') script(type='text/javascript', src='js/lib/angular-bootstrap/ui-bootstrap-tpls.min.js') script(src='js/app.js') script(src='js/config.js') script(src='js/services/global.js') script(src='js/controllers/posts.js') script(src='js/controllers/header.js') script(src='js/filters.js') script(src='js/directives.js')
The repo is here
Update: I posted the issue on github and got referenced to this crazy answer: https://github.com/angular/angular.js/issues/4675
The ng-closure-runner runs an angular specific pass during compilation which adds a definition for MINERR_ASSET, that asset is not included with any of the 1.2.x releases (the only releases with source maps). However, the source map references MINERR_ASSET as a source and as a result there is a 404 when requesting the file.
I've only quickly glanced at the grunt tasks and also ng-closure-runner, but I'm under the impression this is likely the ng-closure-runner included minErr.js or some file generated based on it. Either way the correct asset should be packaged with the other source files or MINERR_ASSET should be removed from the source map "sources".
解决方案Recently I noticed that in Safari I was getting the same error.
"sources":["angular.js","MINERR_ASSET"]
to:
"sources":["angular.js"]
and added non minified version of angularjs files associated with minified version to fixed the console errors. If you are using production version of angularjs, which should be minified version, make sure you add map associated with the library files or you may have unwanted server errors.
这篇关于角MINERR_ASSET未找到404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!