Last updated: Mar 7, 2024
Reading time·3 min
To solve the error "DevTools failed to load SourceMap: Could not load content for chrome-extension":
Click on F12
to open the developer tools or right-click and click
"Inspect".
Click on the Cogwheel in the upper right corner.
Make sure that "Preferences" is selected under "Settings" in the left sidebar.
In the "Sources" section, uncheck the "Enable JavaScript source maps" checkbox to disable it.
script
tag.Note that you should only switch off "Enable JavaScript source maps" and "Enable CSS source maps" if you aren't developing Chrome extensions as that would prevent you from being able to debug your code.
DevTools failed to load SourceMap: Could not load content for chrome-extension://abc/include.preload.js.map: HTTP Error: status code 404, net::ERR_UNKNOWN_URL_SCHEME DevTools failed to load source map: Could not load content for chrome-exension: HTTP error: status code 503, net::ERR_HTTP_RESPONSE_CODE_FAILURE
Once you disable the following 2 options you won't see the "Could not load content for chrome-extension" warnings:
Turning off the 2 options disables source maps in developer tools.
An alternative solution would be to enable the "Selected Context Only" option.
The option is used to hide messages from different JavaScript contexts.
To enable the "Selected Context Only" option:
F12
to open the developer tools or right-click and click
"Inspect".Make sure that "Preferences" is selected under "Settings" in the left sidebar.
In the "Console" section, check the "Selected context only" checkbox to enable it.
Source maps allow us to map a minified file back to an unbuilt state. When you build your JavaScript files for production, you minify and bundle them.
Source maps hold information about the original JavaScript files which helps identify where exactly an error occurred.
However, sometimes you get Source map-related warnings from Chrome extensions that you have no control over, so turning them off is fine.
Alternatively, you can try to find the extension that causes the warnings.
To find the extension that causes the warnings:
Click on the "Manage extensions" button.
Turn off an extension.
Once you find the extension that causes the warnings, you can leave it disabled or contact the extension's developer and report the issue.
Another thing you can try if you can't disable the extension is to click on the "Details" button once you've found the extension that causes the issue and enable "Allow access to file URLs".
The source map warnings are sometimes caused when an extension doesn't have the permissions it requires.
You can learn more about the related topics by checking out the following tutorials: