Search code examples
clojurescriptnashorn

Is there any way to debug clojurescript code from inside Nashorn ?


The question says it all.

I have bugs in my server-side rendered javascript. I am debugging by going line by line, removing it and see if it compiles. Due to the compile time and evaluation of Nashorn, this is very time consuming. Is it possible to get visibility as to where my code is breaking ?

All I see is:

java.lang.ArrayIndexOutOfBoundsException at /my-page 10


Solution

  • The Nashorn exceptions should have the JavaScript trace. See https://docs.oracle.com/javase/8/docs/jdk/api/nashorn/jdk/nashorn/api/scripting/NashornException.html#getScriptStackString-java.lang.Throwable-