Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure Compiler Error with ES6 code and Dojo 1.16.0? #79

Open
dylans opened this issue Dec 2, 2019 · 5 comments
Open

Closure Compiler Error with ES6 code and Dojo 1.16.0? #79

dylans opened this issue Dec 2, 2019 · 5 comments

Comments

@dylans
Copy link
Member

dylans commented Dec 2, 2019

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?

@boualikamel
Copy link

Have the same problem

@msssk
Copy link
Contributor

msssk commented Jan 4, 2020

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.

dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
(cherry picked from commit 86f0042)
dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
(cherry picked from commit 86f0042)
dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
(cherry picked from commit 86f0042)
dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
(cherry picked from commit 86f0042)
dylans pushed a commit that referenced this issue Jun 8, 2020
…1.16.0 (#80)

* Upgraded Closure Compiler

Upgraded the Google Closure Compiler to v20200112

* Fixed a typo

* New format of Closure Compiler errors

The format of a Google Closure Compiler error has changed (see https://github.com/google/closure-compiler/blob/35beaa864997442d635875add4d60b7b73be6294/src/com/google/javascript/jscomp/LightweightMessageFormatter.java#L113-L116)

* Fixed shutting Closure Executor Service down

The API accessing the Closure Executor Service has changed in this commit: google/closure-compiler@7bdbe96

* Allow compiling dojo's non-strict-mode code

1. Assume the Google Closure Compiler's input as non-strict-mode JavaScript

2. Do not emit "use strict"; in the transpiled output

3. Force reporting DiagnosticGroups.ES5_STRICT issues as warnings, instead of errors
(cherry picked from commit 86f0042)
@sindilevich
Copy link
Contributor

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

@dylans
Copy link
Member Author

dylans commented Jun 9, 2020

@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!

@dasa
Copy link
Contributor

dasa commented May 3, 2022

Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants