Closed jwr closed 3 years ago
thanks for reporting this, resolve in 0.12.6
Thanks! (though I don't think 0.12.6 is available on Clojars yet)
Also, thank you for all your work on Rum. Any chance Github sponsors will approve you anytime soon? Has anything changed?
@roman01la Any hint when 0.12.6 will be available on clojars? Still not there :)
just pushed
Hmm. After switching to 0.12.6 I still get the same problem, just one function deeper:
ERROR [] - Doesn't support name: [object Object]
Stacktrace: cljs$core$name@http://localhost:10555/js/out/cljs/core.js:31225:17
daiquiri$util$fragment_tag_QMARK_@http://localhost:10555/js/out/daiquiri/util.js:73:54
daiquiri$util$fragment_QMARK_@http://localhost:10555/js/out/daiquiri/util.js:76:90
daiquiri$interpreter$interpret_vec@http://localhost:10555/js/out/daiquiri/interpreter.js:155:38
daiquiri$interpreter$interpret@http://localhost:10555/js/out/daiquiri/interpreter.js:172:47
I think this is caused by vectors of components, as created by this code:
(rum/defc icon-list < rum/static [atts]
(when (seq atts)
[:.icon-list {}
(mapv (fn [{:attachment/keys [id type content-type] :as att}]
(rum/with-key (icon-link (attachment/url att) type content-type) id))
(sort-by :attachment/timestamp > atts))]))
Looking at the interpreter, when it sees a vector, it seems to assume that it can call name
on the first element, which will not be true for vectors of components.
I don't think I can reopen this issue, but it should be reopened — the problem still exists.
Just FYI, this is a showstopper bug, which keeps me stuck on 0.12.3.
@jwr could you please double check this with current master? I'm not able to reproduce the issue
Well, not with the current master, but I re-tested with 0.12.6 (which seems to be identical to the master code-wise). I still see the problem, with the exact same data as in my comment from Apr 7 above.
@jwr should be fixed now, please try test again from master
I can confirm that this fixes the issue — this might be a good time to release a version including this fix?
@jwr Released in 0.12.7
Thank you, much appreciated!
As I'm trying to migrate to rum 0.12, I get lots of errors like this one:
From what I can understand, it seems those happen when daiquiri encounters a structure like this example:
[:div [[:div] [:div]]]
, which I thought was legal.Looking at
interpret
, it callsfragment?
first, which throws an error if it can't usename
, and thecond
ininterpret
never has a chance to get to the:else (interpret-seq x)
clause.I think I'm missing something: I'm not sure I understand how this code can work at all, unless nobody generates multiple children of an element. That's why I'm not proposing any code or fixes. (EDIT: I just checked, and
fragment?
was introduced in rum 0.12.4, which might explain why this hasn't been noticed by more people)