grych / drab

Remote controlled frontend framework for Phoenix.
https://tg.pl/drab
MIT License
871 stars 43 forks source link

Drab.run_handler no more working in Phoenix 1.3 #62

Closed massetech closed 6 years ago

massetech commented 6 years ago

I follow your guide on the demo page : https://tg.pl/drab/nojquery (by the way the demo page doesn't work either)

My button : <a class="waves-effect waves-light btn grey" onclick="Drab.run_handler('click', 'clicked', {click: 'clickety-click'});">

My method : def clicked(socket, payload) do socket |> Drab.Browser.console("You've sent me this: #{payload |> inspect}") end

The error I get : Transport: Phoenix.Transports.WebSocket Parameters: %{"event" => "click", "event_handler_function" => "clicked", "payload" => %{"click" => "clickety-click"}, "reply_to" => "8a0affa7-1dd2-4e9d-95d8-9441897eb747"

[error] Drab Handler failed with the following exception: ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: ...

After closing the js pop up I get a callback : [debug] INCOMING "execjs" on "__drab:same_path:/packs/1" to Drab.Channel Transport: Phoenix.Transports.WebSocket Parameters: %{"ok" =>["SFMyNTY.g3QAAAACZAAEZGF0YWgCZ2QADW5vbm9kZUBub2hvc3QAAA6mAAAAAAByAANkAA1ub25vZGVAbm9ob3N0AAAAj__RLAABgxyz62QABnNpZ25lZG4GAAPPMjNfAQ.2KVP7lyR4fOT_q4tZNBGdCA3dzZFZX5fXWMV_gc-Xjg", nil]}

massetech commented 6 years ago

Hi Grych

is it fixed and should I update my dependencies to get the correction ?

txs

grych commented 6 years ago

The fix will be in incoming release (probably next week), or you may now try with the github "master"