193

I am getting this error in the Google chrome developer console.

Failed to parse SourceMap: http://localhost:15132/Scripts/_External/igniteui/css/themes/infragistics/infragistics.theme.css.map

How do I fix it?

sclv
  • 38,665
  • 7
  • 99
  • 204
AhammadaliPK
  • 3,448
  • 4
  • 21
  • 39

12 Answers12

333

Chrome recently added support for source maps in the developer tools. If you go under settings on the chrome developer toolbar you can see the following two options:

Chrome Developer Tools Source Maps

If you disable those two options, and refresh the browser, it should no longer ask for source maps.

These settings can be found here:

Chrome Developer Tools Source Maps

Steropes
  • 4,600
  • 2
  • 22
  • 26
  • 106
    what a stupid "feature". It should just load sourcemaps when they're available. – ProblemsOfSumit Jun 10 '16 at 09:06
  • 9
    Two sections up from this screenshot under Appearance is the Theme option. I've chosen the Dark theme. – Steropes Jun 10 '16 at 14:35
  • I need the source maps, but there is one map that isn't available for me. Lurking on Meteor forums indicates that Chrome has become pickier about content (certain names or unexpected format). I just have to ignore this error. – Turbo Jul 19 '16 at 18:12
  • 89
    I don't think this is the answer. Hiding an error is not 'fixing' it, really. You need to figure out why you have a file referencing a non-existent source map file in the first place and then try to fix that. – demisx Aug 19 '16 at 21:32
  • 4
    Just a word of caution - if you disable those settings, be aware that your network tab will NOT show any traffic activity unless you hit F5 (on the n/w tab) – James Poulose Feb 02 '17 at 20:44
  • This solution worked for me. Although I must say, I never saw this warning happen until I deleted and edited some default files within a react app. So maybe, I accidently deleted something integral to the setup. I'll check for warnings before I edit my next react app. – Goku Oct 27 '20 at 17:45
  • What happens if we disable source maps – Inês Barata Feio Borges Jan 02 '21 at 12:58
36

While the chosen answer is a good answer to hide the error, it doesn't make the error go away, it's just that you can't see it in the inspector. The other way would be to download the missing map file and put it in the assets/lib directory. So, for example, I was missing angular-route.min.js.map file and I went here https://code.angularjs.org/1.5.3/ (to the correct version of angular) and downloaded the missing file. The error didn't disappear right away, possibly because of caching, but once I went to the actual file in the browser it worked. http://sitename.localhost/assets/lib/angular-route.min.js.map. Now the inspector no longer displays the error even with source maps enabled.

Chemist
  • 967
  • 2
  • 15
  • 28
  • 4
    While source maps are great for working with minified javascript files, this error message appears and prevents normal debugging even when you don't need/want to use source maps. You're right that adding a source map would fix the issue, but if you don't have them, you'll want to disable this option to allow normal debugging. – Steropes May 03 '16 at 18:41
  • 1
    This was helpful to me because I was trying to set up Backendless.min.js and was seeing `Failed to parse SourceMap` in the Chrome console. When I switched to using the uncompressed Backendless.js (without the `.min`), I didn't get the error. I guess maybe source maps don't make sense when using minified javascript? I guess I could try to set up my local dev environment to use uncompressed JS + source maps and have only the production environment use compressed JS. – Ryan Jun 05 '16 at 16:26
16

Further to just simply turning off Source Maps in Chrome - I've done a little digging and found that using Web Essentials to create the source maps seems to be the issue.

For whatever reason, if I use an external compiler (Koala) I can successfully create working source maps in Chrome (no errors). Whereas if I use Web Essentials, the source maps fail to parse.

Hope this helps someone.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Vicky
  • 161
  • 2
  • 3
    Have you found any word from the Web Essentials team on this? I think we are having the same problem. – jtheis Mar 18 '16 at 21:21
  • 2
    Unfortunately I can't find anything about it - i'm in the process of inquiring! – Vicky Mar 21 '16 at 08:50
  • 1
    A Web Essentials-related fix can be found here: [Google Chrome “Failed parsing SourceMap” : css.map (Web Essential)](http://stackoverflow.com/questions/36133715/google-chrome-failed-parsing-sourcemap-css-map-web-essential) – Quentin S. Aug 31 '16 at 12:26
16

Source code of CSS/JS we usually minified/compress. Now if we want to debug those minified files then we have to add following line at the end of minified file

/*# sourceMappingURL=bootstrap.min.css.map */

This tells compiler where is source file actually mapped.

In the case of JS its make sense
but in the case of CSS, its actually debugging of SCSS.

To Remove Warning: remove /*# sourceMappingURL=bootstrap.min.css.map */ from the end of minified file, .

Wasim A.
  • 9,660
  • 22
  • 90
  • 120
8

I had the same problem because .htaccess has incorrect settings:

RewriteEngine on
RewriteRule !.(js|gif|jpg|png|css)$ index.php


I solved this by modifying the file:

RewriteEngine on
RewriteRule !.(js|gif|jpg|png|css|eot|svg|ttf|woff|woff2|map)$ index.php

Kas Elvirov
  • 7,394
  • 4
  • 40
  • 62
6

For cra/react-scripts 5.0.0 it looks like there is a bug. I had to create a .env file and add the following

GENERATE_SOURCEMAP=false

Note: This is a patch. Once a fix is implemented you will want to remove the line and update to fixed patch version.

Update: react-script 5.0.1 does not fix this issue unfortunately

Roger Perez
  • 2,807
  • 29
  • 31
4

This may sometimes be caused by Chrome extensions you've installed. For example, AdBlock.

Unfortunately the best solution I could find was to disable the offending extension.

Vael Victus
  • 3,966
  • 7
  • 34
  • 55
3

When I had this issue the cause was a relative reference to template files when using the ui.bootstrap.modal module.

templateUrl: 'js/templates/modal.html'

This works from a root domain (www.example.com) but when a path is added (www.example.com/path/) the reference breaks. The answer in my case was simply to making the reference absolute (js/ -> /js/).

templateUrl: '/js/templates/modal.html'

robstarbuck
  • 6,893
  • 2
  • 41
  • 40
2

The error in the Google DevTools are caused Google extensions.

  1. I clicked on my Google icon in the browser
  2. created a guest profile at the bottom of the popup window.
  3. I then pasted my localhost address and voila!!

No more errors in the console.

1

Check if you're using some Chrome extension (Night mode or something else). Disable that and see if the 'inject' gone.

BolonhaDev
  • 11
  • 1
0

I noticed that problem because of AdBlock Extension, I turned off AdBlock extension the issue got resolve.

0

Issue: Source maps 404

Windows 10 (all updated), Google Version 105.0.5195.102 (Official Build) (64-bit).

Fix was to DISABLE Add Block extension.