graaljs
graaljs copied to clipboard
Question: Source maps and debugging support from JDK?
Hi!
Is debugging and source map features only available when using node or is there some way to do any of this using JDK?
Source maps would be useful to us because we're transpiling and bundling from typescript, and of course when an error occurs, the referenced line is currently the bundled one instead of the inlined source map reference.
Thanks!
This question on stackoverflow.com may cover what you are looking for.
Nevermind. I need the chrome inspector dependency.
Will look into that and come back, thanks.
OK. I got the debugger working, great! Thanks.
However when an error is thrown from within the script do not add any hinting towards where in the typescript this relates to.
Exception in thread "main" Error: some error
at <js> map(typescript-bundling/target/classes/js/index.js:601:25551-25569)
Would there be a way to enhance this?
@pintomau I had this question a while ago. I've ended up by reformating the exception textual content on my logger, replacing the character indexes by, the line and column indexes so later I can plugin the source maps or like you did, just rely on the debugger:
https://github.com/reactiverse/es4x/blob/develop/es4x/src/main/java/io/reactiverse/es4x/jul/ANSIFormatter.java#L181-L275
Thanks for the hints, @pmlopes . Will look into it.
Also noticed VertxFileSystem that seems to allow loading files from within the JAR, as claimed in https://github.com/reactiverse/es4x/blob/98bc57a0210940946652cf15129300a5f9f48322/docs/advanced/commonjs.md#specific-differences. Interesting, as we eventually would also like to be able to load node_modules from within the jar.