Hi, is there a way to debug KotlinJs Code on NodeJ...
# javascript
f
Hi, is there a way to debug KotlinJs Code on NodeJs with Intellij?
f
Your
www
file or
App
is writed in kotlin or JS?
f
Kotlin, i'm using the gradle "run" task, to run Node
f
@Foso, I have the
www
file writed with JS and every time I call my Debug task automatically enter inside my Kotlin code. I understand that it does it because I have JS maps enabled.
Sry, I have not tried much
run
task
f
Ok, thank you, its good know that there is a way, i will take a look how it works with the www file
f
@Foso, I found this guide: Kotlin JS Debug but I dont know if you add breakpoint in Intellij enter in your Kotlin code. If you have enable JS maps in your build of gradle it should work.
@Foso, what matters are the JS maps for debug Attributes Specific for JS :
Copy code
compileKotlinJs{
        kotlinOptions.sourceMap = true
        kotlinOptions.sourceMapEmbedSources = "always"
    }
i
Hi, since 1.3.70 there is way, you can right click on
run
task and choose debug, and it should run debug for nodejs. No additional configuration required, source maps are already configured
f
how can i connect to the Debugger? When i run Node from the terminal with "inspect" i can connect and debug Kotlin inside Chrome. But when i use the "run" with debug, i cannot connect
i
If you have IDEA Ultimate and Kotlin plugin with version higher than 1.3.70 (both idea plugin and gradle plugin), it should work automatically, if you right click on Gradle task
run
or
nodeRun
Additionally you can put additional arg to the
exec
task
--inspect-brk
and then create Run configuration
Attach to Node.JS
, it is available in Ultimate version of Idea
👍 1