Closed sritchie closed 10 years ago
@sritchie I have the same issue. Did you manage to solve it?
I opened that jar
file and read /dommy/attrs.cljs
. It's amazing to find there is no symbol ->node-like
anywhere in the file! So the warning message is at the very least fascinating.
Downgrading clojurescript
to version 0.0-2322
mysteriously solves the issue.
Well, it's coming in from the macro definition (on my phone now, so can't link). Check the line the error references, then see the definition of that macro.
— Sent from Mailbox
On Sat, Oct 4, 2014 at 4:08 PM, Carlos Cunha notifications@github.com wrote:
Downgrading
clojurescript
to version0.0-2322
mysteriously solves the issue.Reply to this email directly or view it on GitHub: https://github.com/Prismatic/dommy/issues/83#issuecomment-57920031
It's amazing to find there is no symbol ->node-like anywhere in the file!
There's nothing in that line as I have mentioned before.
Maybe it's spurious. Not even sure it had any impact in my app.
Okay, back at my computer.
At line 37, that warning comes in because of the macroexpansion of node
here: https://github.com/Prismatic/dommy/blob/master/src/dommy/attrs.cljs#L37
Here's the code for node
:
https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L155
So that line gets expanded to (dommy.template/->node-like ~data)
before getting passed into the cljs compiler. That's why it thinks that that symbol exists on that line, because of macro-expansion.
There's no actual error when you run your program if, down the road, some other file requires dommy.template.
The solution would be to require dommy.template
in dommy.attrs
. This would kill the warnings.
Thanks for the in-depth investigation.
The solution would be to require dommy.template in dommy.attrs. This would kill the warnings.
So this is a problem with the compiler. But polluting the codebase with requires for every similar problem doesn't seem correct, imo.
I prefer to not the use that compiler version until the issue is fixed.
Sure, fine by me. Closing.
It's not clear to me that this is a compiler bug. The compiler has been recently enhanced to catch more issues so it might be the case here. @ccfontes If you believe that this is a compiler issue maybe it should be tracked in the CLJS JIRA?
I understand from the response to this question that the node
macro could be modified to fix the warning. It would also be safer as current code should not run and might break in the future.
Maybe this issue should be reopened?
This is not a ClojureScript compiler bug. It should be documented in the library what dependencies are implied by macro usage.
When I try to compile cljs with Clojure 1.7, I see a bunch of warnings like this:
WARNING: Use of undeclared Var dommy.template/->node-like at line 37 file:/Users/sritchie/.m2/repository/prismatic/dommy/0.1.3/dommy-0.1.3.jar!/dommy/attrs.cljs
I'm guessing that requiring
dommy.template
in that namespace will fix this up.