Closure Compiler issues

658
6
Jump to solution
06-02-2021 07:15 PM
JethroLeevers
New Contributor III

Hi All,

 

I have recently been moving a project of mine from local builds (windows) to Jenkins (ubuntu).

Everything builds fine on my local machine but when I try to build on Jenkins the build fails with the following diff in build-report.txt.

/dist/dojo/dojo.js:. OPTIMIZER FAILED: JavaException: java.lang.RuntimeException: Exception parsing "dojo.js.uncompressed.js"

I beleive this is the closure compiler having an exception:

Has anyone else had this issue?

Is there a way to get more verbose logging from the closure compiler?

Is the something else I may be able to do to find the cause of this issue?

 

Cheers,

Jethro

 

P.S. FYI

Jenkins:

ubuntu@ip-xxx-xx-x-xxx:~$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
ubuntu@ip-xxx-xx-x-xxx:~$ npm -v
7.15.1
ubuntu@ip-xxx-xx-x-xxx:~$ node -v
v16.2.0

 

Local:

C:\DEV2021\OctonionDojo>java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

C:\DEV2021\OctonionDojo>npm -v
7.15.1

C:\DEV2021\OctonionDojo>node -v
v12.16.2

0 Kudos
1 Solution

Accepted Solutions
JethroLeevers
New Contributor III

I added:

export _JAVA_OPTIONS=-Xmx2048m

to my build script and it seems to be working

View solution in original post

0 Kudos
6 Replies
JethroLeevers
New Contributor III
0 Kudos
AndyGup
Esri Regular Contributor

Hi @JethroLeevers since it is a parse error, one thing is to make sure you have this set:  https://github.com/Esri/jsapi-resources/blob/master/4.x/amd/dojo/build.profile.js#L491 

0 Kudos
JethroLeevers
New Contributor III

Yes, I already have these set

0 Kudos
DasaPaddock
Esri Regular Contributor

> Is there a way to get more verbose logging from the closure compiler?

Besides the build-report.txt, the regular console output can sometimes show more details.

Since the only difference appears to be the OS, try to look for any issues like paths used in Windows vs. Linux.

0 Kudos
JethroLeevers
New Contributor III

Digging furthur into this issue, the problem seems to be related to the jvm heap size being exceeded when processing dojo.js.uncompressed.js

That being said, is there a way to control the jvm stack size from the build scripts or should I be looking at a build environment setting?

0 Kudos
JethroLeevers
New Contributor III

I added:

export _JAVA_OPTIONS=-Xmx2048m

to my build script and it seems to be working

0 Kudos