clojurescript 2025-10-10

I cannot get google.string.htmlEscape to work - I get compilation errors ๐Ÿงต

โœ… 1

I have something like

(:require 
  [goog.string :as gstring]
  [goog.string.format]
  #_[goog.string.htmlEscape])
(ref: https://clojurescript.org/reference/google-closure-library#requiring-a-function) and gstring/format works, but commenting in [goog.string.htmlEscape] gives me
Compilation failed!
The required namespace "goog.string.htmlEscape" is not available, it was required by "myns/core.cljc".
(Shadow-cljs)

Why is htmlEscape behaving differently than format?

Oh ... just using gstring/htmlEscape without the additional require works ...

Well, thanks for rubber-ducking ๐Ÿ˜„

Leaving this for reference; apparently sometimes the additonal require is mandatory, sometimes, it needs to be avoided.

Yes, that warning on the linked page is very pertinent: > Sometimes symbols are not auto-included when requiring their parent namespace. This happens when those symbols are in their own file and require specific inclusion

๐Ÿ‘ 1