Hi,
I noticed that when an error in my logic bubble ups, it leads to an ArgumentError
in LiveView and that makes debugging the actual error a bit more tedious because it’s all formatted as a single error. Here’s an example:
[error] #PID<0.838.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.809.0>, stream id 2) terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
** (ArgumentError) assign/3 expects a socket from Phoenix.LiveView/Phoenix.LiveComponent or an assigns map from Phoenix.Component as first argument, got: %{reason: %KeyError{key: :acount, term: #Glossia.Accounts.User<__meta__: #Ecto.Schema.Metadata<:loaded, "users">, id: 1, email: "pedro@pepicrft.me", confirmed_at: nil, credentials: #Ecto.Association.NotLoaded<association :credentials is not loaded>, account_id: 1, account: #Ecto.Association.NotLoaded<association :account is not loaded>, organizations: #Ecto.Association.NotLoaded<association :organizations is not loaded>, inserted_at: ~N[2023-07-20 17:38:49], updated_at: ~N[2023-07-20 17:38:49], ...>, message: nil}, status: 500, stack: [{GlossiaWeb.MarketingHTML, :"-index_app/1-fun-0-", 2, [file: ~c"lib/glossia_web/controllers/marketing_html/app/index.heex"
I wonder if it might have something to do with my configuration.