jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)

前端 未结 11 1466
后悔当初
后悔当初 2020-11-22 08:34

I\'m seeing error messages about a file, min.map, being not found:

GET jQuery\'s jquery-1.10.2.min.map is triggering a 404 (Not Found)

<
相关标签:
11条回答
  • 2020-11-22 08:46
    1. Download the map file and the uncompressed version of jQuery.
      Put them with the minified version:

      JavaScript

    2. Include minified version into your HTML:

      HTML

    3. Check in Google Chrome:

      Google Chrome

    4. Read Introduction to JavaScript Source Maps

    5. Get familiar with Debugging JavaScript

    0 讨论(0)
  • 2020-11-22 08:46

    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.

    0 讨论(0)
  • 2020-11-22 08:46

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

    0 讨论(0)
  • 2020-11-22 08:49

    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:

    • In Apache this could be done with with the <FilesMatch> directive or a RewriteRule if you're using mod_rewrite.
    • In IIS you'd need to look to the Web.config file.
    0 讨论(0)
  • 2020-11-22 08:51

    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 :)

    0 讨论(0)
  • 2020-11-22 08:52

    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

    0 讨论(0)
提交回复
热议问题