https://kotlinlang.org logo
c

Claude Brisson

08/11/2022, 10:43 AM
I managed to set up a javascript debug configuration in Intellij Idea, and to add functional breakpoints in my client side kotlin code. But if I try to step over, the IDE loads the big obuscated js file from my project... IDE version is 2022.2.1 Preview Ultimate (but I had the same behavior with the previous version). I'm using js(IR).
b

Big Chungus

08/11/2022, 6:43 PM
Sounds like you're missing sourceMaps
c

Claude Brisson

08/11/2022, 6:56 PM
They seem to be properly generated. And if it was the case, would the IDE be able to stop at a breakpoint in the first place?
b

Big Chungus

08/11/2022, 7:00 PM
Good point! How are you starting the debugger then?
Usually for js you need a separate browser debug run configuration since debug button on regular configs rarely works properly
I.e. run executable and debugger in separate processes
Also add useCommonJs() in your target config if you haven't already. See if that helps.
c

Claude Brisson

08/11/2022, 7:32 PM
I launch the server in a separate process outside the IDE. The debugging session is a "javascript debug" configuration which launches its own chrome browser. Seems to be what you recommend. Adding
useCommonJS()
did nothing. I'm using the latest kotlin plugins, and js(IR).
b

Big Chungus

08/11/2022, 7:45 PM
I'm out of ideas then, apologies.
2 Views