question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with Chrome extension source maps

See original GitHub issue

I’m using Bugsnag in a Chrome extension and am having trouble getting source maps working. I have tried both inline source maps and uploading source maps separately, and neither seem to work.

I’m using webpack with babel transpiler. Source maps generated via the devTools directive in the webpack config.

SS of current result on bugsnag webUI: screen shot 2016-07-12 at 2 51 24 pm

I’m wondering if it has to do with this fix for allowing chrome extension backtraces. Perhaps the source maps do not match up with the doctored stacktraces on the Bugsnag side?

To test that theory, I tried uploading source maps via this doc. The extension source code is not hosted publicly, so I passed in the URL as it would appear to the browser chrome-extension://theidgoeshere/path/to/source. In case it had to do with the stacktrace doctoring, I also tried chrome-extension://theidgoeshere/path/to/source.

Forgive me, I do not really understand the dirty details of source maps nor the particulars of how Bugsnag uses and displays them. Definitely in the dark here!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:18

github_iconTop GitHub Comments

2reactions
flushentitypacketcommented, Feb 6, 2017

Okay, thanks to a suggestion from support, I was able to get 1 reported error working with source maps (I’m assuming the rest will work, haha)!

The issue was that I was misinterpreting minifiedUrl. That url should point to what the Bugsnag client reports to the servers on notify. In other words, it should be the same url as what shows up in your Bugsnag dashboard. Or in even more other words, it should be the same url as what shows up in your Bugsnag stacktraces.

This is especially confusing in chrome-extension land, since the reported stacktrace needs to be modified to get through a Bugsnag filter.

In any case, this is the CURL that did the job for me:

curl https://upload.bugsnag.com/ \
   -F apiKey=apikeygoeshere \
   -F appVersion=versiongoeshere \
   -F minifiedUrl=chromeextension://chromeextensionid/yourfile.js \
   -F sourceMap=@path/to/yourfile.js.map \
   -F minifiedFile=@path/to/yourfile.js \
   -F overwrite=true

Hope this clarifies things for anyone else having this issue.

0reactions
flushentitypacketcommented, Jan 27, 2017

Done

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do source maps work for Chrome extensions? - Stack Overflow
Mapped files are allocated under "Content scripts" tab within "Sources" tab under Developer Tools. There is a source code of all enabled ...
Read more >
sourcemaps are detected but not working in chrome-extension ...
"sourcemaps are detected" message is shown in the sources tab but the original source files are not listed. if the page is loaded...
Read more >
Google Chrome DevTools failed to parse SourceMap
1. It's a mixture of a real bug in Chrome DevTools (it can't load some source maps that it should be able to...
Read more >
Could not load content for chrome-extension:// | bobbyhadz
To solve the error DevTools failed to load SourceMap: Could not load conten for chrome-extension click on `F12` to open the developer tools...
Read more >
Inspect Google Chrome DevTools failed to load source map
resolve BY @whatsup7130 This video is making for Help everyone who are faceing problem for INSPECT section from browser .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found