Zesky665
Drab tutorial error
Hi everyone,
I’m going through the tutorial for drab and got to the case example. After copying the code from the example to my own files, I ran iex -S mix phx.server and visited localhost. When I clicked the uppercase button, I got the following error :
[error] Drab Handler failed with the following exception:
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Floki.HTMLTree, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Postgrex.Stream, Range,Stream
(elixir) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir) lib/enum.ex:141: Enumerable.reduce/3
(elixir) lib/enum.ex:1919: Enum.reduce/3
(drab) lib/drab/live.ex:968: Drab.Live.decrypted_assigns/1
(drab) lib/drab/live.ex:958: Drab.Live.decrypted_from_browser/1
(drab) lib/drab/live.ex:918: Drab.Live.assigns_and_nodrab/1
(drab) lib/drab/live.ex:574: Drab.Live.do_poke/5
(drab) lib/drab.ex:359: anonymous fn/7 in Drab.handle_event/6
Anyone have any idea what this is and how to fix it?
Most Liked
Zesky665
index.html.drab was the answer.
grych
There are two types of standard payload sent from the client to to handler - information about the sender, so the object on which the event was launched, and internal data, specific to the used module - like, in this example, drab_index which is used by Drab.Live.
Considering this, exec_elixir should send the module-specific data. This is what I would expect. So I will update it, as https://github.com/grych/drab/issues/174
grych
I believe I’ve fixed this issue, now module-specific assigns are being added to assigns. Expect the fix in 0.10.0, coming very soon (maybe today?)







