Fork me on GitHub

I posted this on #clojurescript but didn’t get much input and it’s possible it could be relevant here instead, given the compiler-side sort of expertise here: When upgrading from clojurescript v 1.10.764 to 1.10.866 , which notably had 2 goog closure lib upgrades I note with a dev figwheel style build (latest lein-figwheel + cljsbuild) that I suddenly get

Uncaught SyntaxError: Unexpected token '!'
Digging deeper the devtools difference I see in the browser is in the file: <js-compilation-location>/dev/goog/log/log.js I tried the same and got the same issue with 1.10.844 The odd part is in the old cljs version, this file looked like the direct source JS file from google closure lib. In the new cljs version, it instead showing me some transpiled variant, with a header like this:

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
Then the actual offending line is here (with the name truncated a bit):

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
goog.log.ENABLED = goog.define("goog.log.ENABLED", goog.debug.LOGGING_ENABLED);
goog.log.ROOT_LOGGER_NAME = "";
var file_$Users$myuser$_m2$repository$org$clojure$google_closure_library$0_0_20201211_3e6c510d$google_closure_library_0_0_20201211_3e6c510d_jar!$goog$log$log$classdecl$var0 = function(name, value) { = name;
  this.value = value;
You can see in the long var name in the transpiled one there is an “!” used in the name. I don’t know that that’s even a legal JS identifier. This looks to be what is reported. I don’t understand why previously I don’t see this “transpiled” file at all, but with the cljs upgrade now I do. So why it exist now is the first real mystery to me. The second is why it’s producing this invalid name.


I ran into this, what fixed it in my case was removing :language-out :es5


Oh wow. That’s interesting. We have that constraint as well. I think it’s necessary to support IE11 which we still are attempting to do.


I will test this out though. I appreciate the tip off!