closure-compiler-npm: `google-closure-compiler-linux` throwing Java exceptions.

Executing the following command:

npx google-closure-compiler target/resources/main/js/es6-bundle.js > target/resources/main/js/es5-bundle.js --language_in=ECMASCRIPT_2017 --language_out=ECMASCRIPT5 --compilation_level=SIMPLE_OPTIMIZATIONS --rewrite_polyfills=true --warning_level=QUIET --jscomp_off=checkVars --create_source_map target/resources/main/js/es5-bundle.js.map

produces the following error statement:

java.util.zip.ZipException: invalid entry CRC (expected 0x4e1f14a4 but got 0xb1e0eb5b)
        at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:410)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:199)
        at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:143)
        at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.getBuiltinExterns(AbstractCommandLineRunner.java:481)
        at com.google.javascript.jscomp.CommandLineRunner.createExterns(CommandLineRunner.java:2073)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:1168)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:532)
        at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:2231)

I confirmed that the native compiler is executed in this case (from google-closure-compiler-linux package). Force refresh and reinstallation of modules doesn’t fix the problem.

Versions: “20220202.0.0”, “20220405.0.0”

Operating system: Linux 5.10.105-1-MANJARO x86_64

Java version: openjdk 11.0.14 2022-01-18 OpenJDK Runtime Environment Temurin-11.0.14+9 (build 11.0.14+9) OpenJDK 64-Bit Server VM Temurin-11.0.14+9 (build 11.0.14+9, mixed mode)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 17

Most upvoted comments

Here is a single command that will reproduce the problem:

docker run --rm -ti archlinux bash -c "yes | pacman -Sy npm && \
npm i -g google-closure-compiler && google-closure-compiler --version && google-closure-compiler a.js; bash"
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20220405
java.util.zip.ZipException: invalid entry CRC (expected 0x4e1f14a4 but got 0xb1e0eb5b)
        at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:410)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:199)
        at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:143)
        at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.getBuiltinExterns(AbstractCommandLineRunner.java:481)
        at com.google.javascript.jscomp.CommandLineRunner.createExterns(CommandLineRunner.java:2083)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:1168)
        at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:532)
        at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:2241)