1

使用 WebStorm 7.0.1 运行 yeoman 角度生成器 grunt 服务器会抛出:

Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/jquery/jquery.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/angular/angular.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-affix.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-alert.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-dropdown.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-tooltip.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-modal.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-transition.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-button.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-popover.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://www.google-analytics.com/analytics.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-typeahead.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-carousel.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-scrollspy.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-collapse.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-tab.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/scripts/jquery.min.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/scripts/controllers/main.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:9000/scripts/controllers/main.js.map:0
Failed to load resource: the server responded with a status of 404 (Not Found)      http://localhost:35729/livereload.js.map:0

在浏览器加载的文件中搜索.js.map或搜索sourceMappingURL不会返回任何结果,并且在项目源中没有与错误中的这些文件相关的结果。

仅当 WebStorm 连接到 JetBrains IDE 支持插件、初始启动和文件更改实时重新加载时,才会显示错误。它们显示在 IDE 的 javascript 调试控制台和浏览器控制台中,但是一旦打开开发人员工具并从浏览器完成刷新,就不会抛出任何错误(因此我无法在网络选项卡,除非有办法在新选项卡加载时启动开发人员工具,编辑:实际上这也不起作用)。

重现问题的步骤:

  • 安装 yeoman 角度发生器
  • 从这些来源创建一个 webstorm 项目
  • 使用以下配置启动项目(将为 JS 自动创建第二个配置):

节点解释器:pathToNode\nodejs\node.exe

工作目录:ProjectRootFolder

JavaScript 文件:C:\Users\UserName\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt

应用参数:服务器

对于浏览器/实时编辑:

检查启动后

用 JavaScript 调试器检查

开始网址:http://localhost:9000

关于如何调试这些错误的任何想法?谢谢您的帮助!

4

2 回答 2

4

这些消息只是调试输出:Jetbrains IDE Chrome 扩展检查是否存在 js.map 文件,如果未找到,则打印一条消息。进行此检查的原因是某些用于压缩/转换代码的工具不会生成所需的 //sourceMapUrl 注释,调试器需要定位源映射,因此它会检查一些默认位置是否存在地图。因此,这些消息不表示任何错误并且不会造成任何伤害,它们可以被安全地忽略。此调试输出将在下一次插件更新中被过滤掉 - 修复正在进行中

于 2013-11-04T13:51:01.520 回答
1

由于 lena 提到错误无关紧要,我安装了Grep 控制台并添加了一个匹配项以将错误着色为绿色,这样它们就不会引起注意。

我尝试将它们过滤掉,但我不确定为什么这不起作用。

于 2013-11-04T14:30:12.373 回答