最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Error "failed to load resource (map)" when using cdnjs - Stack Overflow

matteradmin8PV0评论

I'm using some files from CDNJS:

<link
  href=".5.2/css/bootstrap.min.css"
  rel="stylesheet"
/>
<link
  href=".14.0/css/all.min.css"
  rel="stylesheet"
  type="text/css"
/> 
[...] 
<script src=".5.1/jquery.slim.min.js"></script>
<script src=".5.2/js/bootstrap.bundle.min.js"></script>

When using this files I get some errors in the console (safari/MacOS):

[Error] Failed to load resource: the server responded with a status of 404 () (bootstrap.bundle.min.js.map, line 0)

[Error] Failed to load resource: the server responded with a status of 404 () (bootstrap.min.css.map, line 0)

I've found out maps are data about the files (is that correct?) Is it possible to fix this or is it a server error?

I'm using some files from CDNJS:

<link
  href="https://cdnjs.cloudflare./ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css"
  rel="stylesheet"
/>
<link
  href="https://cdnjs.cloudflare./ajax/libs/font-awesome/5.14.0/css/all.min.css"
  rel="stylesheet"
  type="text/css"
/> 
[...] 
<script src="https://cdnjs.cloudflare./ajax/libs/jquery/3.5.1/jquery.slim.min.js"></script>
<script src="https://cdnjs.cloudflare./ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>

When using this files I get some errors in the console (safari/MacOS):

[Error] Failed to load resource: the server responded with a status of 404 () (bootstrap.bundle.min.js.map, line 0)

[Error] Failed to load resource: the server responded with a status of 404 () (bootstrap.min.css.map, line 0)

I've found out maps are data about the files (is that correct?) Is it possible to fix this or is it a server error?

Share Improve this question asked Aug 30, 2020 at 12:23 MoPaMoMoPaMo 6848 silver badges27 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Your browser debugger detects minimized JavaScript and CSS and is looking for a map file automatically to normalize it, so it is easier to read. A map file is an instruction file for the browser to "unminify" a minimized JavaScript or CSS file, so that on client side, debugging will be easier, without impacting performance.

Normally getting this error won't effect anything. Actually this error is only thrown if the debugger is open, because the debugger itself caused it. Everything will work as expected anyway. You can ignore those errors.

For more information on how this works and how it's used for see "MDN: Use a source map".

Post a comment

comment list (0)

  1. No comments so far