WebStorm 7

编程入门 行业动态 更新时间:2024-10-11 07:32:47
本文介绍了WebStorm 7 - Yeoman Angular丢失的源映射`加载资源失败:服务器响应状态为404(未找到)`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

运行带有WebStorm 7.0.1的yeoman角度发生器grunt服务器抛出:

加载资源失败:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / jquery / jquery.js.map:0 无法加载资源:服务器响应的状态为404(未找到)http: //localhost:9000/bower_components/angular/angular.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap- sass / js / bootstrap-affix.js.map:0 无法加载资源:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-alert.js.map:0 无法加载资源:服务器响应状态为404(Not Found)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-dropdown。 js.map:0 加载资源失败:服务器响应状态为404(不是找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-tooltip.js.map:0 加载资源失败:服务器响应状态为404(未找到)http: //localhost:9000/bower_components/bootstrap-sass/js/bootstrap-modal.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost: 9000 / bower_components / bootstrap-sass / js / bootstrap-transition.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-button.js.map:0 无法加载资源:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-popover.js.map:0 加载资源失败:服务器响应状态为404(未找到)www.google-analytics/analytics.js.map: 0 加载资源失败:服务器响应状态为404 (未找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-typeahead.js.map:0 加载资源失败:服务器响应状态为404(未找到) http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-carousel.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-scrollspy.js.map:0 无法加载资源:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap-sass / js / bootstrap-collapse.js.map:0 无法加载资源:服务器响应状态为404(未找到)http:// localhost:9000 / bower_components / bootstrap- sass / js / bootstrap-tab.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost:9000 / scripts / jquery.min.map: 0 无法加载资源:服务器响应状态为4 04(未找到)http:// localhost:9000 / scripts / controllers / main.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost :9000 / scripts / controllers / main.js.map:0 加载资源失败:服务器响应状态为404(未找到)http:// localhost:35729 / livereload.js.map:0

搜索 .js.map 或 sourceMappingURL 不会返回任何结果,只有当WebStorm连接到JetBrains IDE支持插件时,才会显示错误,在首次启动时和文件更改实时重新加载时显示。它们显示在IDE的javascript调试控制台中,也显示在浏览器控制台中,但是一旦开发人员工具被打开并且刷新从浏览器完成,就不会引发任何错误(所以我无法检查网络选项卡,除非有一种方法来启动开发人员工具在新的标签加载,编辑:实际上,这也不会工作)。

重现问题的步骤:

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

    节点解释器:pathToNode\\\odejs\\\ode.exe

    工作目录:ProjectRootFolder

    JavaScript file:C:\Users\UserName\AppData\Roaming\\\pm\\\ode_modules\grunt-cli\bin\grunt

    应用程序参数:服务器

    j.mp/1azrdky

    以及浏览器/实时编辑:

    检查启动后使用JavaScript调试器检查

    开始URL: http:// localhost:9000

    j.mp/1azrfJl

    我可以去调试这些错误?感谢您的帮助!

    解决方案

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

    Running the yeoman angular generator grunt server with WebStorm 7.0.1 throws:

    Failed to load resource: the server responded with a status of 404 (Not Found) localhost:9000/bower_components/jquery/jquery.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) localhost:9000/bower_components/angular/angular.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) 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) 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) 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) 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) 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) 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) 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) 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) www.google-analytics/analytics.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) 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) 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) 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) 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) 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) localhost:9000/scripts/jquery.min.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) localhost:9000/scripts/controllers/main.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) localhost:9000/scripts/controllers/main.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) localhost:35729/livereload.js.map:0

    Searching for .js.map or sourceMappingURL in browser loaded files returns no result and in the project source no result related to those files from the error.

    The errors are shown only when WebStorm is connected to the JetBrains IDE Support plugin, on initial launch and on file changes live reload. They are shown in the javascript debug console in the IDE and also in the browser console, but once the developer tools are opened and the refresh is done from the browser there are no errors thrown (so I can't check the request initiator in the network tab, unless there is a way to start developer tools on new tab load, EDIT: actually that wouldn't work either).

    Steps to reproduce the problem:

    • install yeoman angular generator
    • create a webstorm project from those sources
    • start the project using the following configuration (a 2nd configuration will be automatically created for 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

    j.mp/1azrdky

    and for Browser / Live Edit:

    check After launch

    check with JavaScript debugger

    start url: localhost:9000

    j.mp/1azrfJl

    Any ideas about how I could go about debugging these errors? Thank you for your help!

    解决方案

    These messages are just the debug output: the Jetbrains IDE Chrome extension checks for presence of js.map files, and, if not found, prints a message. The reason for this checking is that some tools used to compress/transpile code don't generate required //sourceMapUrl comment the debugger needs to locate sourcemaps, so it checks some default locations for maps presence. So, these messages don't indicate any errors and don't do any harm, they can be safely ignored. This debug output will be filtered out in the next plugin update - fix is in progress

更多推荐

WebStorm 7

本文发布于:2023-08-03 04:37:46,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:WebStorm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!