Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "failed to load resource (map)" when using cdnjs

I'm using some files from CDNJS:

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

like image 779
MoPaMo Avatar asked Oct 27 '25 10:10

MoPaMo


1 Answers

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".

like image 195
Niklas E. Avatar answered Oct 29 '25 01:10

Niklas E.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!