gpt4 book ai didi

javascript - 未找到 Angular MINERR_ASSET 404

转载 作者:数据小太阳 更新时间:2023-10-29 04:19:37 29 4
gpt4 key购买 nike

我在控制台上记录了一个错误:

GET http://localhost:3000/js/lib/angular/MINERR_ASSET 404 (Not Found)     

我看到了this post它说这是没有包含 ngRoute 模块的结果,但我有!

公共(public)/js/app.js:

window.app = angular.module('mean-blog-seed', ['ngCookies', 'ngResource',     'ui.bootstrap', 'ngRoute', 'mean-blog-seed.controllers', 'mean-blog-seed.services']);

然后我有一个引用 angular-route.js 的 jade 文件:

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')

repo 是 here

更新:我在 github 上发布了这个问题并引用了这个疯狂的答案: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".

最佳答案

https://github.com/angular/angular.js/issues/4675

上面的代码让我检查了那个问题,你接到了 ng-closure-runner 的电话(这里:https://github.com/angular/angular.js/blob/a29bff1c98161495fb304d0195c4d2916b357686/bower.json)。

尝试包括 minErr.js在你的 JS 文件中。

关于javascript - 未找到 Angular MINERR_ASSET 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21455370/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com