admin管理员组文章数量:1327802
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: .js/issues/4675
The ng-closure-runner runs an angular specific pass during pilation 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".
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./angular/angular.js/issues/4675
Share Improve this question edited May 23, 2017 at 10:24 CommunityBot 11 silver badge asked Jan 30, 2014 at 11:35 Connor LeechConnor Leech 18.9k32 gold badges110 silver badges160 bronze badges 2The ng-closure-runner runs an angular specific pass during pilation 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".
- have you tried to use absolute path instead of relative and remove base(href='/') ? – shoen Commented Jan 30, 2014 at 15:31
- As I can see the issue is fixed ?github./angular/angular.js/mit/… – Jimmy Kane Commented Feb 10, 2014 at 13:12
4 Answers
Reset to default 1https://github./angular/angular.js/issues/4675
The above code led me to check out that problem and you are getting a call to ng-closure-runner (here: https://github./angular/angular.js/blob/a29bff1c98161495fb304d0195c4d2916b357686/bower.json).
Try including minErr.js in your JS files.
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.
in the .map file, I changed
"sources":["angular.js","MINERR_ASSET"],
to :
"sources":["angular-sanitize.js"]
no longer getting error in console.
I also faced this issue once, make sure you have all three files :
angular-route.js
angular-route.min.js
angular-route.min.js.map
in your library/vendor folder. and your app definition contains ngRoute :
var myApp = angular.module('myApp',['ngRoute']);
Please vote if this resolution helps you. or share your app.js/error if you still have this issue.
Thanks
本文标签: javascriptangular MINERRASSET not found 404Stack Overflow
版权声明:本文标题:javascript - angular MINERR_ASSET not found 404 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742234450a2437815.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论