codyhouse/codyhouse-framework

Error when using google-closure-compiler

TeaEwan opened this issue · 4 comments

Project url: https://github.com/google/closure-compiler

Command: google-closure-compiler --compilation_level ADVANCED --warning_level DEFAULT --js index.js --js_output_file output_index.js

An error message appears:

index.js:260:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
  260| if(!Util) function Util () {};
                          ^^^^

index.js:304:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
  304| if(!Util) function Util () {};
                          ^^^^

index.js:969:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
  969| if(!Util) function Util () {}; 

......

How do you fix it?

Hi there, we are removing the Util dependencies from all our components.
Meanwhile, you can replace the Util functions (e.g., Util.osHasReducedMotion()) with a basic function (e.g. function osHasReducedMotion()). This will fix your issue.

Thank you for your work.

I have noticed that some components have removed Util dependencies, some have not been removed. Will it continue?

Yes, the dependency will be removed from all components.