Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught Error: Invalid arity: 1" when using metadata on a component #39

Closed
Frozenlock opened this issue Jun 27, 2014 · 5 comments
Closed

Comments

@Frozenlock
Copy link

Okay, this is weird...

For an unknown reason, when I add metadata to a component (say :component-did-mount), I get an error when trying to load the JS:

"Uncaught Error: Invalid arity: 1"

I get the same error with an empty metadata.

(defn test-div []
  [:div "hello"])
;; this one works

(def test-div-2
  (with-meta
    test-div
    {:component-did-mount #(.log js/console "asd")}))
;; throws an error

(def test-div-3
  (with-meta test-div nil))
;; throws an error

What's worse is that I've already used this method before, so I know it should work!

Any clue on what might be causing this?

@Frozenlock
Copy link
Author

I dug a little deeper and the problem seems to occur only on the newer versions of cljs.

Everything works fine on clojurecript 0.0-2173 and lein-cljsbuild 1.0.2, but it bugs out on clojurescript 0.0.2234 and lein-cljsbuild 1.0.3.

@ilazarte
Copy link

Also seeing this for 2234 and 1.0.3. Switch back as recommended by frozenlock fixed it for me as well. This is reagent 0.4.2 and react 0.9.0

@jonase
Copy link
Contributor

jonase commented Jul 11, 2014

I can reproduce this issue in 2234 but not in 2268. Here are the list of changes clojure/clojurescript@r2234...r2268 if someone want to investigate the root cause.

@mike-thompson-day8
Copy link
Member

@Frozenlock can we close this issue do you think? I'm guessing we have moved on?

@Frozenlock
Copy link
Author

Yup, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants