clementine icon indicating copy to clipboard operation
clementine copied to clipboard

Uncaught Error: No protocol method IWriter.-write defined for type undefined

Open evjan opened this issue 12 years ago • 5 comments

When I try to follow the instructions at http://yokolet.blogspot.com.au/2012/10/clementine-gem-clojurescript-on-rails.html for my existing Rails site, I get the following error popping up in the Chrome console:

Uncaught Error: No protocol method IWriter.-write defined for type undefined:

Any ideas what can be done about this?

evjan avatar Dec 14 '12 23:12 evjan

Hmmm, I'm not sure what's happening.

Do you have any other exception messages? What options did you set? I'm guessing you tried on CRuby, right?

yokolet avatar Dec 15 '12 22:12 yokolet

I switched to running on JRuby and the problem still persists.

I had no options set. When I set the following option

Clementine.options[:optimizations] = :whitespace

the problem seems to go away.

evjan avatar Dec 22 '12 22:12 evjan

+1 on this, the cljs I'm running is straight from an example: (ns hello) (defn ^:export greet [n](str "Hello " n))

andrewvc avatar Jan 02 '13 07:01 andrewvc

Oddly enough this doesn't seem to prevent execution shrugs (for the record I'm on jruby as well).

andrewvc avatar Jan 02 '13 08:01 andrewvc

Guys, I don't know what Clementine is, but I found this issue report while I was googling for the same error message. I found the solution, so I thought I should share.

In advanced compilation, among other things Closure renames functions. I was using jQuery, and Closure redefined $ - thus breaking code calling jQuery. The solution for me was to include jQuery externs in the compilation and make sure that my CLJS files actually use $.

I'm not sure if you're having issues with jQuery or something else, but your scenario is likely the same. You can catch the error in Firebug and see stacktrace to find it.

konrad-garus avatar Jan 05 '13 16:01 konrad-garus