You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to issue #496, I am running into issues where JsChecker is crashing with an internal error, while JsCompiler reports a meaningful error message.
$ ../../bazel-out/host/bin/external/io_bazel_rules_closure/java/io/bazel/rules/closure/ClosureWorker \
JsChecker --src tpl.js
ERROR: Program threw uncaught exception with args: JsChecker --src tpl.js
java.lang.RuntimeException: Exception parsing "tpl.js"
at com.google.javascript.jscomp.parsing.ParserRunner.parse(ParserRunner.java:155)
at com.google.javascript.jscomp.JsAst.parse(JsAst.java:152)
at com.google.javascript.jscomp.JsAst.getAstRoot(JsAst.java:55)
at com.google.javascript.jscomp.CompilerInput.getAstRoot(CompilerInput.java:133)
at com.google.javascript.jscomp.Compiler.parseInputs(Compiler.java:1714)
at com.google.javascript.jscomp.Compiler.parseForCompilationInternal(Compiler.java:937)
at com.google.javascript.jscomp.Compiler.lambda$parseForCompilation$4(Compiler.java:920)
at com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread(CompilerExecutor.java:129)
at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:824)
at com.google.javascript.jscomp.Compiler.parseForCompilation(Compiler.java:918)
at com.google.javascript.jscomp.Compiler.compile(Compiler.java:674)
at com.google.javascript.jscomp.JsChecker.run(JsChecker.java:255)
at com.google.javascript.jscomp.JsChecker.access$300(JsChecker.java:63)
at com.google.javascript.jscomp.JsChecker$Program.apply(JsChecker.java:354)
at io.bazel.rules.closure.worker.LegacyAspect.run(LegacyAspect.java:38)
at io.bazel.rules.closure.ClosureWorker.run(ClosureWorker.java:69)
at io.bazel.rules.closure.worker.PersistentWorker.runProgram(PersistentWorker.java:109)
at io.bazel.rules.closure.worker.PersistentWorker.run(PersistentWorker.java:88)
at io.bazel.rules.closure.ClosureWorker.main(ClosureWorker.java:111)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 6
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at com.google.javascript.jscomp.parsing.IRFactory.normalizeRegex(IRFactory.java:3538)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processRegExpLiteral(IRFactory.java:2229)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processLiteralExpression(IRFactory.java:3260)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:3353)
at com.google.javascript.jscomp.parsing.IRFactory.transform(IRFactory.java:833)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processBinaryExpressionHelper(IRFactory.java:1835)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processBinaryExpression(IRFactory.java:1811)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:3271)
at com.google.javascript.jscomp.parsing.IRFactory.transform(IRFactory.java:833)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processExpressionStatement(IRFactory.java:1451)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:3303)
at com.google.javascript.jscomp.parsing.IRFactory.transform(IRFactory.java:833)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processAstRoot(IRFactory.java:1303)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:3351)
at com.google.javascript.jscomp.parsing.IRFactory.transformTree(IRFactory.java:344)
at com.google.javascript.jscomp.parsing.ParserRunner.parse(ParserRunner.java:144)
... 18 more
If JsChecker is wrapping JsCompiler, would it be possible for it to emit the same error message as JsCompiler would in this situation, rather than crashing? A crashing compiler doesn't help with fixing the syntax error, and it would be great to be able to just run bazel build and get the useful error message without having to manually run JsCompiler to see what's wrong.
FWIW, I was thinking that maybe this was fixed in a recent version of JsCompiler while JsChecker is using an old one; however, that does not appear to be the case. The commit of this repo I'm using (62746bd) includes JsCompiler version v20200614 (as of commit d69cb55), but the output from JsCompiler is the same at that version as well:
Similar to issue #496, I am running into issues where JsChecker is crashing with an internal error, while JsCompiler reports a meaningful error message.
Here's a relevant excerpt from my
WORKSPACE
:Here's a minified example of a problematic file:
JsChecker fails on this file:
whereas JsCompiler reports an error message:
If JsChecker is wrapping JsCompiler, would it be possible for it to emit the same error message as JsCompiler would in this situation, rather than crashing? A crashing compiler doesn't help with fixing the syntax error, and it would be great to be able to just run
bazel build
and get the useful error message without having to manually run JsCompiler to see what's wrong.FWIW, I was thinking that maybe this was fixed in a recent version of JsCompiler while JsChecker is using an old one; however, that does not appear to be the case. The commit of this repo I'm using (62746bd) includes JsCompiler version v20200614 (as of commit d69cb55), but the output from JsCompiler is the same at that version as well:
The text was updated successfully, but these errors were encountered: