MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.67k stars 4.78k forks source link

"DevTools failed to parse SourceMap" #8167

Closed wbt closed 3 years ago

wbt commented 4 years ago

Describe the bug When opening a page with MetaMask-enabled Chrome, and developer tools are open, two console warnings are observed:

DevTools failed to parse SourceMap: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map DevTools failed to parse SourceMap: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map

To Reproduce (REQUIRED) Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:

I have MetaMask 7.7.7 installed in up-to-date Google Chrome Version 80.0.3987.132 (Official Build) (64-bit) on Windows 10.

I press F12 to open the browser console.

When I navigate to any site over http(s), (e.g. https://www.google.com/) I get the above two errors. By viewing chrome://extensions/, I verify that the nonsense string corresponds to the id for my MetaMask extension.

Expected behavior No console warnings, ideally because the browser can find and parse SourceMaps. (This would also be helpful in debugging other issues and possibly fixing them via the open-source process.)

wbt commented 4 years ago

If the information is helpful, this issue has been around for a while and isn't new in 7.7.7.

vuldin commented 4 years ago

This is the same behavior in metamask v 7.7.7 on Firefox 74.0b9 on Windows.

SatyanarayanaGhadiyaram commented 4 years ago

By when is this issue expected to be resolved ?

wbt commented 4 years ago

By when is this issue expected to be resolved ?

Probably shortly after someone volunteers to fix it. There are other issues (example) which are much older, higher-impact, and higher-priority than this one, which are no closer to getting resolved, and the code for doing that is much more readily available as open-source in this project. The issue on this page is most likely resolved by modifying the build process to include the source maps in the distribution bundle; code for that is a little harder to access.

wbt commented 4 years ago

I am also recently but regularly seeing a console 404 ERROR, with the browser unsuccessfully trying to access inpage.js.map:

source-map-support.js:87 GET .../chrome-extension:/sourcemaps/inpage.js.map 404 (Not Found) (anonymous) @ source-map-support.js:87 (anonymous) @ source-map-support.js:55 (anonymous) @ source-map-support.js:169 (anonymous) @ source-map-support.js:55 mapSourcePosition @ source-map-support.js:186 wrapCallSite @ source-map-support.js:367 prepareStackTrace @ source-map-support.js:416 f @ inpage.js:1 a.addListener @ inpage.js:1 RequestManager.setProvider @ index.js:98 pkg.setProvider @ index.js:69 Eth.setProvider @ index.js:75 Web3.setProvider @ index.js:58 Web3Shim @ index.js:50 Web3InterfaceAdapter @ index.js:6 exports.createInterfaceAdapter @ index.js:15 configureNetwork @ constructorMethods.js:16 setProvider @ constructorMethods.js:39 ...

I can see why it's trying to get this, looking at the successfully fetched inpage.js line 2:

//# sourceMappingURL=../sourcemaps/inpage.js.map

That inpage.js is from a chrome-extension:// URL matching the extension ID for MetaMask, so the issue belongs here. This is on Chrome v81.0.4044.92 (Official Build) (64-bit) for Windows 10.

mudgen commented 4 years ago

Can this error be fixed? I am developing using DevTools and these constant errors are annoying.

kumavis commented 4 years ago

i dont see this error in MetaMask v7.7.8 on chromium Version 81.0.4044.113 (Official Build) snap (64-bit) i do see this in MetaMask v7.7.8 on firefox 75.0 (64-bit)

on google.com I see

Source map error: Error: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://4057c680-3752-49fb-9363-08b02140c203/contentscript.js
Source Map URL: ../sourcemaps/contentscript.js.map
mudgen commented 4 years ago

Thanks for looking into it.

I get these errors in my DevTools console on any web page load:

DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

I am using Google Chrome Version 81.0.4044.113 (Official Build) (64-bit)

If I disable the MetaMask extension then the errors go away.

shravsA commented 4 years ago

Hello, can anybody help me with how to solve this MetaMask error? I need the metamask extension for the site so disabling it isn't an option. -DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME -DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME Any help within a day would be seriously gratified.

wbt commented 4 years ago

@systnock your best bet is to just ignore the error. The error is mostly an annoyance affecting developers and should not be a real issue for most regular users.

codeham297 commented 4 years ago

@systnock your best bet is to just ignore the error. The error is mostly an annoyance affecting developers and should not be a real issue for most regular users.

I hate this thing! It comes out every time I pop the chrome dev tools, I feel like I'm doing something wrong in my code

wbt commented 4 years ago

@codeham297 I agree!

There is a PR which might fix this, but it's blocked by this one which is blocked by a desire to keep changes to a minimum until Login Per Site is out the door, so we'll probably have to wait on all of this to be completed before this annoyance is fixed.

If it makes you feel better by comparison, open the console on major corporate or banking websites.

adityaj0220 commented 4 years ago

@wbt was this issue solved or is it yet to be solved since I am getting the same difficulty now.

wbt commented 4 years ago

The issue is not solved. Unless you would like to fix it, which would apparently require completing the Login Per Site functionality (for project administration reasons, not technical ones) the correct workaround is to ignore it.

You could also build and use your own version of MetaMask using this fork of the project and see if that fixes it (please report back if it does or not compared with the main repo branch, if you have it successfully built and running).

adityaj0220 commented 4 years ago

@wbt I chose to ignore it as such, since i got the work done without it as well

Esqarrouth commented 4 years ago

FIX THIS

Gudahtt commented 3 years ago

Thanks for the report! I'm closing this as a duplicate of #7077, which appears to be about the same issue

framerate commented 3 years ago

The issue is not solved

Is this still the stance for this? I'm jumping between issues trying to understand. I'm a JS developer and also an metamask user and need to make sure my error log is clean.

Is this something I can expect to be fixed eventually or is it a no-fix?

FYI to anyone else who lands here, my solution is to just "disable" the extension in chrome and when I'm on OpenSea etc I just turn it back on. Seems ok for now.

Gudahtt commented 3 years ago

The intent is to fix this issue. It is being tracked in #7077; please follow that issue for updates. Thanks!

framerate commented 3 years ago

Thank you!!