Search code examples
vert.xintellij-14vertx-verticle

Debug JS Verticle vertx


Is there a way to debug a javascript verticle in intellij(or any other app/tool) like you can debug it on any browser dev tool? I have tried adding debugger to the code but doesn't work and I could literally find nothing online on this.


Solution

  • You can debug from IntelliJ IDEA. I'm currently on version (2017.2.4) and this is how it works. Assuming you have a minimal js project (for reference I've used this generator: http://vertx-starter.jetdrone.xyz/)

    I've added 2 breakpoints to the generated main_verticle.js file:

    add breakpoint

    Now you need to configure your runner, for this you need to create a run configuration of type Application with the following config:

    enter image description here

    • Main Class: always io.vertx.core.Launcher
    • Program Arguments: run your_js_file.js

    You can test the configuration by running it and see that the server starts. Now to debug just press the debug icon and you should get:

    debug session