MV3 and Webpack source map

195 views
Skip to first unread message

Toan Nguyen

unread,
Dec 24, 2021, 3:07:38 AM12/24/21
to Chromium Extensions
MV3 template with Webpack and Typescript
Hello, I have been creating Chrome extension using the above template for MV2 extensions. However, with MV3, I encounter this issue when loading the built extension, and then inspection.

```
DevTools failed to load source map: Could not load content for chrome-extension://<extension_id>/background.bundle.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
```

Has anybody here encountered the same issue? Is there anyway to resolve this?

Thank you!

Cuyler Stuwe

unread,
Dec 24, 2021, 2:02:49 PM12/24/21
to Chromium Extensions, canhtoan...@gmail.com
I always create inline source maps. That resolves this, as the source maps aren't in a file, but instead in a massive comment at the end of each file.

Cuyler Stuwe

unread,
Dec 24, 2021, 2:04:08 PM12/24/21
to Chromium Extensions, Cuyler Stuwe, canhtoan...@gmail.com
Worth stressing is that source maps are only really a DX experience if you're using the debugger.

If you don't do that (e.g., if you're one of most developers who seem to use only console log statements for debugging), then this will have no meaningful impact on you.

avm99963

unread,
Dec 26, 2021, 8:05:14 AM12/26/21
to Chromium Extensions, salem...@gmail.com, canhtoan...@gmail.com
Added to what Salem said, I'd like to say that the issue that non-inline source maps cannot be loaded in devtools is being tracked here: https://crbug.com/212374.

It was recently fixed, but the fix had to be reverted because of https://crbug.com/1281823.
Reply all
Reply to author
Forward
0 new messages