ReferenceError: $jscomp is not defined
See original GitHub issueHello! I’ve downloaded the most recent version of compiler and i’ve tried to optimize js code with these flags: java -jar closure-compiler-v20211006.jar -W VERBOSE -O WHITESPACE_ONLY --language_out ECMASCRIPT5 $script_path_in --js_output_file $script_path_tmp
closure compiler has optimized this lines of code:
for(var extraProperty of extraProperties){
option.setAttribute(extraProperty,initialOption[extraProperty]);
}
into
for (var $jscomp$iter$0 = $jscomp.makeIterator(extraProperties), $jscomp$key$extraProperty = $jscomp$iter$0.next(); !$jscomp$key$extraProperty.done; $jscomp$key$extraProperty = $jscomp$iter$0.next()) {
var extraProperty = $jscomp$key$extraProperty.value;
{
option.setAttribute(extraProperty, initialOption[extraProperty])
}
}
And as a result i receive such error in browser: all_compressed.js Uncaught ReferenceError: $jscomp is not defined
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
ReferenceError: $jscomp is not defined · Issue #40 - GitHub
Works with :simple optimizations. Breaks like this with :whitespace optimizations: ❯ clj -M:test -x chrome-headless Chrome Headless 88.0.
Read more >$jscomp not defined in code loaded for clojurescript and reagent
0, I am running into an error in which a file index.js tries to reference $jscomp , which is not defined. I've seen...
Read more >JS Console error on Minification - Adobe Experience League ...
Solved: When try to Minify files under clientlibs using JsProcessor, facing some Console errors and the files are not minified too. Console -...
Read more >Error '$jscomp is not defined' When Publishing Plugin
I am having the same issue with a private plugin that works on the developer's account but not on mine. I get the...
Read more >ReferenceError: $jscomp is not defined
Hi, Just downloaded yesterday the latest trial version of Siesta, v5.1.1, but can't run any launcher. My server hosts siesta folder, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brad4d was that implemented already? We are hitting the same issue in ClojureScript (which relies on Closure) where
$jscomp
is undefined whenlanguage out
is set toes5
. Is there a workaround that doesn’t involve setting optimizations tosimple
? We’ve started seeing it after upgrade of Closure fromv20210505
tov20220601
@brad4d Here’s a repository demoing a tiny reproduction case for the issue @roman01la mentioned. In our case the issue seems to be rooted in ES6 classes that extend from other classes and
$jscomp.inherits
being undefined: https://github.com/stigi/clojurescript-es5-issue