sourceMap file on remote server, and source code file on local server

112 views
Skip to first unread message

毅易

unread,
Nov 19, 2022, 6:41:24 AM11/19/22
to Chrome DevTools
Hi All
I would be sorry if this is a duplicated question, but I really didn't find an answer.
I'm developing a GWT project, and I have it running on a remote Jboss server. I'd like to debug the program but met some problem. The project running on remote server has it's SourceMap file, but no source code file in the war package, which is for reducing package size purpose. So the SourceMap can't find related source code.
I'm wondering is there any way to import local source code file into the Chrome, so it can source map to the code and I can debug? I tried add local file folder to "Sources" panel's "Filesystem" tab, but it doesn't work.
Hope someone can help me. Thanks.
屏幕截图 2022-11-18 180731.jpg

PhistucK

unread,
Nov 19, 2022, 7:32:12 AM11/19/22
to google-chrome-...@googlegroups.com
I assume the result of your build is a big bundle with a source map comment at the end. I think you can right click within the tab of the original file (the minified bundle) and put a URL to your own local source map instead via "Add source map...".
Alternatively, in order not to repeat this process every time you reload the page, if you have an extension that can change response headers, maybe add the SourceMap header with the local URL.
image.png


PhistucK


--
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/cca5fd49-5f42-469e-945c-21b2abfb4838n%40googlegroups.com.

毅易

unread,
Dec 2, 2022, 4:03:35 AM12/2/22
to Chrome DevTools
Thank you  PhistucK, yes, I added my local source map file successfully, source code shows.But it dosen't hit breakpoint I set. Any idea why?

屏幕截图 2022-12-02 170253.jpg

PhistucK

unread,
Dec 2, 2022, 7:42:38 AM12/2/22
to google-chrome-...@googlegroups.com
Press F1 to go to the settings of the developer tools and uncheck "Enable JavaScript source maps" - is the breakpoint still there? Does it point to something that looks like the right code?
If not, it may be that the source map is a bit faulty, or a developer tools bug.

PhistucK


毅易

unread,
Dec 4, 2022, 8:05:57 PM12/4/22
to Chrome DevTools
Yes! The source map I used does not match, cause I used different compilers for local and production source map. I changed it then it goes well! Thanks a lot man!
Reply all
Reply to author
Forward
0 new messages