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

Uknown option --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT #25

Open
rjcorwin opened this issue Jul 23, 2018 · 4 comments
Open

Uknown option --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT #25

rjcorwin opened this issue Jul 23, 2018 · 4 comments

Comments

@rjcorwin
Copy link

I'm getting the following error when building.

Use --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT to enable ES6 features

Adding this suggested option to ./build.sh results in crashing as well. Am I missing something?

@wwalc
Copy link
Member

wwalc commented Jul 30, 2018

Unfortunately CKBuilder does not support ES6 syntax and this flag. The error comes from Closure Compiler, which is used internally by CKBuilder.

It means that even if you want to use such a simple thing such as let or const instead of var, CKBuilder will not let you do this and will fail throwing this error about unsupported ES6 syntax.

I tried to update Closure Compiler in CKBuilder and add support for ES6, but unfortunately the first attempt ended up with strange errors (Cannot convert UTF-8 to java.nio.charset.Charset just to name the first issue). Update: the builder kinda works, but does not pass all tests.

As a workaround, at least for the time being, you need to translate the plugin to ES5 and then run CKBuilder with it.

@rjcorwin
Copy link
Author

rjcorwin commented Jul 30, 2018

you need to translate the plugin to ES5 and then run CKBuilder with it.

Gotcha, we could babel it first, then run CKBuilder.

@rjcorwin
Copy link
Author

Thanks @wwalc !

@wwalc
Copy link
Member

wwalc commented Jul 31, 2018

Short update: it looks like I have to give up for now with adding the ES6 support. I pushed my changes to the es6 branch (no es6 support yet, just updated closure compiler). After I updated the closure compiler to version 20180716 it started complaining about many issues that it did not complain about before, for example:

This language feature is only supported for ECMASCRIPT6 mode or better: block-scoped function declaration.

when using CS with ES5 mode (which we should continue using for the online builder) (com.google.javascript.jscomp.CompilerOptions.LanguageMode.ECMASCRIPT5).

Unfortunately failing on errors like this would be a major problem for the online builder, because many 3rd party plugins include such code.

While I completely agree that such code should be cleaned up, the reality is that it would take months for 3rd party maintainers to correct their plugins and some of them would have to be fixed by us, because we may expect that some plugins are also no longer actively maintained.

So in other words, this grows to quite a time consuming task:

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

2 participants