I have three instances of an app on different machines that I have updates a LiveView page to.
These three machines are Local Machine, a Dev Machine and Live Machine.
The app on Local Machine is a clone of the Phoenix App on Live Machine. I literally copied it over before working on it.
The live view page I edited is named: page_live.ex
On Local Machine I edited page_live.ex and then copied it to Dev Machine in the same directory it was in on the Live Machine.
The change worked and rendered as expected and Dev Machine updated accordingly. I thought "hey , I’ll update the Live Machine " now.
On my Live machine when I upload the file I get this syntax error:
KeyError at GET /
key :color not found in: nil. If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
# KeyError at GET /
Exception:
** (KeyError) key :color not found in: nil. If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
(app 0.1.0) lib/app_web/live/page_live.ex:506: anonymous fn/4 in AppWeb.PageLive.render/1
(elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
(app 0.1.0) lib/app_web/live/page_live.ex:501: anonymous fn/2 in AppWeb.PageLive.render/1
All the dependencies I see between systems are the same. The Dev Machine and the Live Machine have the same version of Elixir.
What can be wrong?
I have not run phx.deps.get yet as I am waiting for my server admin buddy to make a backup first but I am unsure how that would fix this as I did not need to do it with the Dev Machine
Thank you.
EDIT
I just grabbed all the code off Live Machine and re-copied it to another directory on my Local Machine.
Runing it gave me some non related errors so I deleted the .build directory and did mix phx.digest
I manually copied over the new page_live.ex file and it works with no error.
I am not sure why copying it over to directly to Live Machine doesn’t work the same.
Like I said, maybe it will be solved by a rebuild but it’s still a weird error.