2

现在,当浏览器请求 jquery.min.map 时,我得到了这个 404 错误。

有趣的是,我从未将此文件添加到我的解决方案中。

谁能向我解释如何解决这个错误?

我不知道这个文件在哪里被引用,因为我没有添加对这个文件的引用。

Request URL:http://localhost:22773/Scripts/jquery.min.map
Request Method:GET
Status Code:404 Not Found
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:localhost:22773
Referer:http://localhost:22773/Manager/ControlPanel.aspx
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36
Response Headersview source
Cache-Control:private
Content-Length:4992
Content-Type:text/html; charset=utf-8
Date:Tue, 10 Sep 2013 17:37:40 GMT
Server:Microsoft-IIS/8.0
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?YzpcdXNlcnNcYWRtaW5pc3RyYXRvclxkb2N1bWVudHNcdmlzdWFsIHN0dWRpbyAyMDEyXFByb2plY3RzXEFsdW1DbG91ZFxBbHVtQ2xvdWRcU2NyaXB0c1xqcXVlcnkubWluLm1hcA==?=
4

2 回答 2

8

Source maps are like favicons, a thing that will be loaded by browsers in some circumstances.

Typically, javascript are minified on production servers and debugging javascript on them is difficult.

Source maps are the original versions of minified javascript. It's up to the developers to include them or not on their websites.

In Chrome, you have to activate this functionality for the browser to attempt to download the original non-minified version of a minified script. It is then easier to debug client-side.

Basically, you can't get rid of this error besides providing source maps.

Anyways, see: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

于 2013-09-10T17:56:22.747 回答
0

我刚刚在我自己的应用程序中修复了这个问题。

从 CDN 复制的文件通常在底部有 sourcemap 行。对于 axios.min.js,它是

//# sourceMappingURL=axios.min.map

只需删除该行,您就不会收到该错误。更好的是,使用他们为本地加载提供的版本。

我在开发没有可靠互联网访问的东西时遇到了这个问题,所以我需要本地版本。删除那条线解决了这个问题。

于 2021-02-18T02:08:50.023 回答