Fork me on GitHub
#cljs-dev
<
2024-04-18
>
thheller06:04:06

another argument to why dropping stacktraces sucks 😛 I added the stacktrace for the error, so we know at least where it fails 😛

thheller06:04:08

30 | (def data #::b {:x 1 :y 2 :z 3})
---------------------^----------------------------------------------------------
No namespace: app.b found
	clojure.tools.reader/read* (reader.clj:953)
	clojure.tools.reader/read* (reader.clj:917)
	clojure.tools.reader/read-delimited (reader.clj:198)
	clojure.tools.reader/read-delimited (reader.clj:191)
	clojure.tools.reader/read-list (reader.clj:209)
	clojure.tools.reader/read-list (reader.clj:205)
	clojure.tools.reader/read* (reader.clj:935)
	clojure.tools.reader/read* (reader.clj:917)
	clojure.tools.reader/read (reader.clj:988)
	clojure.tools.reader/read (reader.clj:961)
    ...
Caused by:
Exception: No namespace: app.b found
	clojure.core/the-ns (core.clj:4163)
	clojure.core/ns-name (core.clj:4165)
	clojure.core/ns-name (core.clj:4165)
	clojure.tools.reader/read-namespaced-map (reader.clj:762)
	clojure.tools.reader/read-namespaced-map (reader.clj:753)
	clojure.tools.reader/read-dispatch (reader.clj:72)
	clojure.tools.reader/read-dispatch (reader.clj:68)
	clojure.tools.reader/read* (reader.clj:935)
	clojure.tools.reader/read* (reader.clj:917)
	clojure.tools.reader/read-delimited (reader.clj:198)
	clojure.tools.reader/read-delimited (reader.clj:191)
	clojure.tools.reader/read-list (reader.clj:209)
	clojure.tools.reader/read-list (reader.clj:205)
	clojure.tools.reader/read* (reader.clj:935)
	clojure.tools.reader/read* (reader.clj:917)
	clojure.tools.reader/read (reader.clj:988)
	clojure.tools.reader/read (reader.clj:961)

thheller06:04:56

(this is with shadow-cljs, regular cljs likely would have the vendorized reader variant)

thheller06:04:43

ok, so the issue is that *alias-map* contains the {b app.b} symbol. that gets passed to ns-name which for symbols calls find-ns. since its just an alias it doesn't exist.

thheller06:04:08

seems like it should have a special case for whether it has a Namespace instance or a symbol? since all it needs is the string, creating a dummy empty ns seems pointless? although this is already done for all cljs namespaces anyway, so not a big deal

bronsa08:04:11

yeah that explains why the {::foo/bar} syntax works -- it uses str instead of ns-name

bronsa08:04:38

seems an innocuous enough change to make, will do

bronsa08:04:48

fix pushed to master, if anybody can confirm that fixes it, I'll do a release

thheller11:04:03

@bronsa yep, confirmed fixed

bronsa11:04:26

cool, will make a release

🎸 4
lilactown14:04:19

thanks y'all! that was super fast