your programing

jQuery의 jquery-1.10.2.min.map이 404 (찾을 수 없음)를 트리거합니다.

lovepro 2020. 9. 27. 13:33
반응형

jQuery의 jquery-1.10.2.min.map이 404 (찾을 수 없음)를 트리거합니다.


파일을 min.map찾을 수 없다는 오류 메시지 가 표시됩니다.

GET jQuery의 jquery-1.10.2.min.map이 404 (찾을 수 없음)를 트리거합니다.


스크린 샷

여기에 이미지 설명 입력

이게 어디서 오는거야?


크롬 DevTools로는 .MAP 파일의 404을보고하는 경우 (아마도 jquery-1.10.2.min.map, jquery.min.map또는 jquery-2.0.3.min.map알고 먼저이 DevTools로를 사용하는 경우이 만 요구하지만, 아무것도 일어날 수 있습니다.) 사용자는이 404를 누르지 않습니다.

이제이 문제를 수정하거나 소스 맵 기능을 비활성화 할 수 있습니다.

수정 : 파일 가져 오기

다음으로 쉬운 수정입니다. 머리 http://jquery.com/download/ 과는 클릭 다운로드를지도 파일 버전에 링크를, 당신은 압축되지 않은 파일뿐만 아니라 다운로드 할 것입니다.

여기에 이미지 설명 입력

장소에 맵 파일을 갖는 것은 당신이 변수 같은 이름을 다루는 마음에 들지 않으면 시간과 좌절을 많이 절약 할 수 원본 소스를 통해 축소 된 jQuery를 디버깅 할 수 있습니다 ac.

소스 맵 에 대한 추가 정보 : JavaScript 소스 맵 소개

닷지 : 소스 맵 비활성화

파일을 가져 오는 대신 설정에서 JavaScript 소스 맵을 완전히 비활성화 할 수도 있습니다. 이 페이지에서 JavaScript를 디버깅 할 계획이없는 경우 좋은 선택입니다. DevTools의 오른쪽 하단에있는 톱니 바퀴 아이콘을 사용하여 설정을 열고 다음을 수행합니다.여기에 이미지 설명 입력


라인을 제거하여 404를 제거 할 수 있습니다.

//@ sourceMappingURL=jquery-1.10.2.min.map

jQuery 파일의 상단 부분에서.

jQuery 파일의 상단 부분은 다음과 같습니다.

/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/

그냥 변경하십시오

/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license */

소스 맵의 목적

Basically it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location. Developer tools (currently WebKit nightly builds, Google Chrome, or Firefox 23+) can parse the source map automatically and make it appear as though you're running unminified and uncombined files. (Read more on this here)


As it is announced in jQuery 1.11.0/2.1.0 Beta 2 Released the source map comment will be removed so the issue will not appear in newer versions of jQuery.

Here is the official announcement:

One of the changes we’ve made in this beta is to remove the sourcemap comment. Sourcemaps have proven to be a very problematic and puzzling thing to developers, generating scores of confused questions on forums like StackOverflow and causing users to think jQuery itself was broken.

Anyway, if you need to use a source map, it still be available:

We’ll still be generating and distributing sourcemaps, but you will need to add the appropriate sourcemap comment at the end of the minified file if the browser does not support manually associating map files (currently, none do). If you generate your own jQuery file using the custom build process, the sourcemap comment will be present in the minified file and the map is generated; you can either leave it in and use sourcemaps or edit it out and ignore the map file entirely.

Here you can find more details about the changes.


Here you can find confirmation that with the jQuery 1.11.0/2.1.0 Released the source-map comment in the minified file is removed.


  1. Download the map file and the uncompressed version of jQuery. Put them with the minified version: 자바 스크립트

  2. Include minified version into your HTML: HTML

  3. Check in Google Chrome: 구글 크롬

  4. Read Introduction to JavaScript Source Maps

  5. Get familiar with Debugging JavaScript


The new versions of jQuery require this file http://code.jquery.com/jquery-1.10.2.min.map

The usability of this file is described here http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

Update:

jQuery 1.11.0/2.1.0

// sourceMappingURL comment is not included in the compressed file.


As I understand the browser, Chrome at least, it doesn't disable the source mapping by default. That means your application's users will trigger this source-mapping request by default.

You can remove the source mapping by deleting the //@ sourceMappingURL=jquery.min.map from your JavaScript file.


If you want to get source map file different version, you can use this link http://code.jquery.com/jquery-x.xx.x.min.map

Instead x.xx.x put your version number.

Note: Some links, which you get on this method, may be broken :)


After following the instructions in the other answers, I needed to strip the version from the map file for this to work for me.

Example: Rename

jquery-1.9.1.min.map

to

jquery.min.map


I was presented with the same issue. The cause for me was Grunt concatenating my JavaScript file.

I was using a ;\n as a separator which caused the path to the source map to 404.

So dev tools was looking for jquery.min.map; instead of jquery.min.map.

I know that isn't the answer to the original question, but I am sure there are others out there with a similar Grunt configuration.


jQuery 1.11.0/2.1.0 the // sourceMappingURL comment is not included in the compressed file.


Assuming you've checked the file is actually present on the server, this could also be caused by your web server restricting which file types are served:

참고 URL : https://stackoverflow.com/questions/18365315/jquerys-jquery-1-10-2-min-map-is-triggering-a-404-not-found

반응형