util icon indicating copy to clipboard operation
util copied to clipboard

Closure Compiler Error with ES6 code and Dojo 1.16.0?

Open dylans opened this issue 6 years ago • 5 comments

https://discourse.dojo.io/t/closure-compiler-strict-errors/456

As reported by yassam:

I’m using Dojo 1.16.0.

The Dojo build system is giving me INTERNAL COMPILER ERROR on my ES6 code. I figure this might be due to a buggy version of the Closure compiler shipped with Dojo, so I downloaded the latest version of the Closure compiler and I now get a bunch of errors in the dojo code itself.

It complains about dojo code not compiling in strict mode, even though I haven’t set strict mode.

Specifically, here’s the relevant part of my build profile:

layerOptimize: 'closure', optimize: 'closure',

optimizeOptions: { languageIn: 'ECMASCRIPT6', languageOut: 'ECMASCRIPT5' },

Note that the input language is ECMASCRIPT6 not ECMASCRIPT6_STRICT

Is there an easy way to get the latest version of the closure compiler to work?

dylans avatar Dec 02 '19 13:12 dylans

Have the same problem

boualikamel avatar Dec 31 '19 13:12 boualikamel

Can you provide a (preferably minimal) test case for this? Dojo 1.16 includes a version of the Closure compiler that is a few years old, but it does have some ES6 support. I am able to build a simple app with a few ES6 features (const, spread operator, object shorthand) without issue, but adding arrow functions results in the INTERNAL COMPILER ERROR. Downloading Closure compiler v20191111 and replacing util/closureCompiler/compiler.jar with it I am able to successfully compile code with arrow functions as well. The warning messages for Dojo code have changed, but I am not seeing any errors.

msssk avatar Jan 04 '20 04:01 msssk

@dylans, is the original reporter still can check whether the changes introduced in https://github.com/dojo/util/pull/80 solve the issue?

sindilevich avatar Jun 09 '20 10:06 sindilevich

@dylans, is the original reporter still can check whether the changes introduced in #80 solve the issue?

I've reached out and asked them to verify. Thanks for reminding me!

dylans avatar Jun 09 '20 13:06 dylans

Can this be closed?

dasa avatar May 03 '22 18:05 dasa