Skip to first unread message

Rohan Gupta

unread,
Feb 19, 2023, 6:36:56 PM2/19/23
to Chrome DevTools
Hello!

I am debugging a website where source maps are enabled. But chrome doesn't detect it. After searching I found that https://developer.chrome.com/docs/devtools/javascript/source-maps/#sourceurl_and_displayname the .js files were missing the source map comment.

So, what I did was to right click and choose Add Source Maps and copy the .js file URL and append .map to it. But this things is difficult to do for each and every file. That worked for me and I was able to see the clean code in the form webpack://

I am looking for some way I can automate this process, without everytime doing the same thing for so many 20-30 .js files. For every file I just need to append .map in the end.

Please help with some solution maybe some extension, or some hacky way of programtically loading source maps using dev tools. 

Yang Guo

unread,
Feb 20, 2023, 3:25:35 AM2/20/23
to google-chrome-...@googlegroups.com, Benedikt Meurer
Sounds like you need a source map map ;)


--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/0fd444bc-327c-4048-9d19-ce03f53643b3n%40googlegroups.com.

Benedikt Meurer

unread,
Feb 20, 2023, 4:29:32 AM2/20/23
to Yang Guo, google-chrome-...@googlegroups.com
Per Source Map Revision 3 Proposal, there are currently two ways to link to source maps:
  1. The //# sourceMappingURL=<url> annotations that you already noticed.
  2. The SourceMap: <url> HTTP header.
It sounds like the former is not an option for you (no way you can tell the build system to emit these annotations?), so adding the HTTP header to your server might be your best bet then.

HTH,
Benedikt
--

Benedikt Meurer

 • Chrome DevTools Lead

 Google Munich  

 • bme...@google.com


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Liana Sebastian

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Yang Guo

unread,
Feb 20, 2023, 4:31:07 AM2/20/23
to Benedikt Meurer, google-chrome-...@googlegroups.com
If you cannot change the HTTP header setting of your server, you can try to override the HTTP header in DevTools as described here.
Reply all
Reply to author
Forward
0 new messages