使用Vscode的 open with live server 打开html 页面, 但换成360浏览器后报错 failed to load resource:the server responded with a status of 404 (Not Found)
时间: 2023-11-05 10:05:34 浏览: 390
使用Vscode的 open with live server 打开html页面后,在切换到360浏览器时可能会报错 "failed to load resource: the server responded with a status of 404 (Not Found)"。这个错误表示服务器无法找到所请求的资源。解决这个问题的方法有两个方案。
方案一:修改配置文件
1. 找到config文件夹下的index.js文件。
2. 打开index.js文件,找到assetsPublicPath,并将其值修改为"./"。
3. 保存文件,并重新打开html页面。
方案二:检查跨域问题
1. 检查是否存在跨域问题,跨域问题可能导致服务器无法访问所请求的资源。
2. 如果存在跨域问题,可以尝试通过以下方法解决:
- 修改端口号:将Vscode的live server设置中的端口号改为其他可用的端口号,如3000。
- 搜索如何更改360浏览器的端口号,或尝试使用其他浏览器打开html页面。
相关问题
vscode右键快捷打开html页面报错Failed to load resource: the server responded with a status of 404 (Not Found)
这个错误通常是由于文件路径问题引起的。请确保你的HTML文件位于正确的位置,并且在VS Code中的文件资源管理器中显示为可见。
另外,请确保你的服务器配置正确,并且在访问HTML文件时没有任何错误。你可以检查你的服务器配置文件,比如Apache的httpd.conf或Nginx的nginx.conf,确保文件路径与实际位置匹配。
如果问题仍然存在,请提供更多的详细信息,比如你的文件结构和服务器配置,这样我可以帮助你更准确地解决问题。
vscode运行js报错Failed to load resource: the server responded with a status of 404 (Not Found)
根据你提供的引用内容,当在VSCode中运行JavaScript代码时出现"Failed to load resource: the server responded with a status of 404 (Not Found)"的错误,可能有两种可能性。
第一种可能是在运行过程中,代码中引用的静态资源(如css、js、images)的路径有误,导致服务器无法找到相应的资源文件。这可能是因为在配置静态资源路径时出现了错误或者资源文件的位置不正确。你可以检查代码中引用资源文件的路径是否正确,并确保相应的资源文件确实存在于指定的路径中。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [idea写web项目时报错Failed to load resource: the server responded with a status of 404 (Not Found)](https://blog.csdn.net/perturb/article/details/125948103)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [使用Cdn引入vue.js控制台报错Failed to load resource: the server responded with a status of 404 (Not ...](https://blog.csdn.net/blackbak/article/details/129912594)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文
相关推荐















