How to suppress Chrome DevTools warning: 'DevTools failed to load SourceMap: Could not load content for...'
Asked Answered
D

5

28

Context

For many of my js files I have no source map. When using the devtools console it pollutes the warnings about that. I would not like to turn of all warnings, but those are not really useful for me

Question

How to suppress Chrome DevTools warning: 'DevTools failed to load SourceMap: Could not load content for...'?

Doctorate answered 12/5, 2020 at 8:4 Comment(3)
I use a filter in the toolbar, puu.sh/FJo1m/eb54eab44e.pngWhiffet
Many thx. Could you please post as an answer, an also the filter expression in text form too I am going to accept it.Doctorate
A better way is to use DevTools to persist the suppression, I have put some screenshots in an answer to this question.Feer
A
13

In DevTools (F12) -> Settings (F1) :

Disable both "enable JS source maps" and "enable CSS source maps" in "Preferences -> Sources"

Analeptic answered 2/6, 2020 at 10:49 Comment(3)
This disables source maps altogether. While I guess its technically a solution, it removes important functionality at the same time. Its not about having NO source maps, its about just getting rid of the annoying warnings.Chryso
On mac os it is called: "enable Javascript source maps"Curley
This shouldn't be the accepted solution... Removing source maps is not beneficial, just to silence warnings.Hesperidin
W
27

Hide them via console filter like -/(load|parse)\sSourceMap/

enter image description here

(using a /regexp/ with \s seems to be the only working method of specifying strings with spaces)

Whiffet answered 12/5, 2020 at 8:34 Comment(6)
Is there a way to persist this? and/or be able to filter still?Plainsong
True but if it's in there, I cannot filter by any other queries. Or rather I need to append another "minus" filter.Plainsong
No, you'll have to use an external text/clipboard utility to quickly insert your snippets.Whiffet
@Joe you can add multiple queries by separating them with a comma + space (e.g. -query1, -query2)Dale
This should be the accepted answer as it only remove source maps warnings and not the whole source maps featureDull
In Chrome 108 the warning text is different, I used the filter -/(load|parse)\ssource\smap/.Vazquez
A
13

In DevTools (F12) -> Settings (F1) :

Disable both "enable JS source maps" and "enable CSS source maps" in "Preferences -> Sources"

Analeptic answered 2/6, 2020 at 10:49 Comment(3)
This disables source maps altogether. While I guess its technically a solution, it removes important functionality at the same time. Its not about having NO source maps, its about just getting rid of the annoying warnings.Chryso
On mac os it is called: "enable Javascript source maps"Curley
This shouldn't be the accepted solution... Removing source maps is not beneficial, just to silence warnings.Hesperidin
F
7

If you open DevTools (F12) then look for the cog "Preferences" top/right you can disable "Enable JavaScript source maps" under the Sources section by un-checking that option.

Find the cog (preferences) Find the option

Feer answered 21/10, 2020 at 3:48 Comment(1)
Disabling source maps is not a solution. Source maps are useful for developers, removing them is not an option.Hesperidin
B
1

This solution is only if you don't want to use that particular extension (which is causing the issue) on your site or to remove the addon from your browser.

  • Goto the console. enter image description here

Click on the link that is printedn in the console log. the link starts with "chrome-extension", it will take you to the extension's page, you can find the name in the address bar

Screenshot of chrome extension

Go to the extensions( Chrome menu > More tools > Extensions ). You can either remove it from the browser or restrict the access by changing the site access to On click choosing from the options of the extension as below.

enter image description here

Bejarano answered 2/12, 2021 at 15:1 Comment(0)
B
0

Often, these messages are caused by other contexts, such as extensions or workers. You can make the console only show those messages, that originated from the selected context (e.g. top).

Console tab -> Settings icon (top right) -> Make sure Selected context only is selected.

Console setttings

Biel answered 7/7, 2023 at 7:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.