gpt4 book ai didi

node.js - WebStorm 7 - Yeoman Angular 缺少源映射 `Failed to load resource: the server responded with a status of 404 (Not Found)`

转载 作者:太空宇宙 更新时间:2023-11-03 22:47:51 24 4
gpt4 key购买 nike

使用 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.mapsourceMappingURL 不会返回任何结果,并且在项目源中也不会出现与错误中的这些文件相关的结果。

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

重现问题的步骤:

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

Node interpreter: pathToNode\nodejs\node.exe

Working directory: ProjectRootFolder

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

Application param: server

对于浏览器/实时编辑:

check After launch

check with JavaScript debugger

start url: http://localhost:9000

关于如何调试这些错误有什么想法吗?感谢您的帮助!

最佳答案

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

关于node.js - WebStorm 7 - Yeoman Angular 缺少源映射 `Failed to load resource: the server responded with a status of 404 (Not Found)`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19769069/

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