google / closure-compiler-js

Package for the JS version of closure-compiler for use via NPM
https://github.com/google/closure-compiler
Apache License 2.0
1.84k stars 64 forks source link

INTERNAL COMPILER ERROR. Please report this problem. undefined Node(ASSIGN) #63

Closed simonsarris closed 6 years ago

simonsarris commented 7 years ago

I'm using the closure compiler with TypeScript output. In one class (class Util) I have:

static 'vfo' = '@vfo'; // version info

Which turns into:

Util['vfo'] = '@vfo'; // version info

Which is pretty close to the JS I use with the Java Closure compiler and it has no problem with it.

Then when I use webpack with my JS (that was output from TS with tsc) and the closure compiler, I get:

C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:4529
function FFb(b){var c;try{return b.Xh()}catch(a){a=Xgb(a);if($K(a,70)){c=a;throw Ygb(new eJ(c))}else throw Ygb(a)}}
                                                                           ^

Error: java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR. Please report this problem.  undefined   Node(ASSIGN): go.js:15477:0 Ut
   Parent(EXPR_RESULT): go.js:15477:0 Util['vfo'] = '@vfo'; // version info
    at AG (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:7628:22102)
    at DG (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:7628:22303)
    at eJ (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:3482:76)
    at FFb (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:4529:86)
    at FDb (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:6320:95)
    at J6c (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:7255:359)
    at tJ (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:1746:29)
    at wJ (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:3043:44)
    at C:\SomePath\buildTS\node_modules\google-closure-compiler-js\jscomp.js:3215:46
    at module.exports (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\compile.js:31:15)
    at C:\SomePath\buildTS\node_modules\google-closure-compiler-js\lib\webpack.js:52:28
    at Array.forEach (native)
    at C:\SomePath\buildTS\node_modules\google-closure-compiler-js\lib\webpack.js:40:17
    at Array.forEach (native)
    at Compilation.<anonymous> (C:\SomePath\buildTS\node_modules\google-closure-compiler-js\lib\webpack.js:38:16)
    at Compilation.applyPluginsAsyncSeries (C:\SomePath\buildTS\node_modules\tapable\lib\Tapable.js:142:13)
    at C:\SomePath\buildTS\node_modules\webpack\lib\Compilation.js:631:10
    at Compilation.applyPluginsAsyncSeries (C:\SomePath\buildTS\node_modules\tapable\lib\Tapable.js:131:46)
    at sealPart2 (C:\SomePath\buildTS\node_modules\webpack\lib\Compilation.js:627:9)
    at Compilation.applyPluginsAsyncSeries (C:\SomePath\buildTS\node_modules\tapable\lib\Tapable.js:131:46)
    at Compilation.seal (C:\SomePath\buildTS\node_modules\webpack\lib\Compilation.js:575:8)
    at C:\SomePath\buildTS\node_modules\webpack\lib\Compiler.js:488:16
    at C:\SomePath\buildTS\node_modules\tapable\lib\Tapable.js:225:11
    at C:\SomePath\buildTS\node_modules\webpack\lib\Compilation.js:477:11
    at C:\SomePath\buildTS\node_modules\webpack\lib\Compilation.js:448:13
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Eyeballing it, I'm really not sure why this line would be a problem. If I comment it out, a similar static line is problematic.

MatrixFrog commented 7 years ago

cc @alexeagle

simonsarris commented 7 years ago

Hmm, this problem does not seem specific to this project (but also to the regular closure compiler with the tsc output passed to it)

Dominator008 commented 7 years ago

@simonsarris Could you provide a stack trace from the regular / Java version of Closure Compiler? I admit the stack trace from GWT is currently unusable. Thanks.

simonsarris commented 7 years ago
C:\SomePath\buildTS> java -jar .\closure-compiler.jar --js_output_file=go.js '../built/**.js' --jscomp_off=deprecatedAnnotations
java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

null
  Node(ASSIGN): ../built/util.js:653:0
Util['vfo'] = '@vfo'; // version info
  Parent(EXPR_RESULT): ../built/util.js:653:0
Util['vfo'] = '@vfo'; // version info

        at com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread(CompilerExecutor.java:126)
        at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:753)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:723)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:693)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:1080)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:492)
        at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:1898)
Caused by: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

null
  Node(ASSIGN): ../built/util.js:653:0
Util['vfo'] = '@vfo'; // version info
  Parent(EXPR_RESULT): ../built/util.js:653:0
Util['vfo'] = '@vfo'; // version info

        at com.google.common.base.Preconditions.checkState(Preconditions.java:429)
        at com.google.javascript.jscomp.CheckJSDoc.isValidMsgName(CheckJSDoc.java:375)
        at com.google.javascript.jscomp.CheckJSDoc.validateMsgJsDoc(CheckJSDoc.java:351)
        at com.google.javascript.jscomp.CheckJSDoc.visit(CheckJSDoc.java:90)
        at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:639)
        at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:711)
        at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:635)
        at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:711)
        at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:635)
        at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:711)
        at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:635)
        at com.google.javascript.jscomp.NodeTraversal.traverse(NodeTraversal.java:311)
        at com.google.javascript.jscomp.NodeTraversal.traverseEs6(NodeTraversal.java:582)
        at com.google.javascript.jscomp.CheckJSDoc.process(CheckJSDoc.java:77)
        at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:304)
        at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:236)
        at com.google.javascript.jscomp.Compiler.check(Compiler.java:892)
        at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:781)
        at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:87)
        at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:726)
        at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:723)
        at com.google.javascript.jscomp.CompilerExecutor$2.call(CompilerExecutor.java:91)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException
        ... 26 more
ChadKillingsworth commented 6 years ago

Crashes in the compiler need to be reported to https://github.com/google/closure-compiler.