Comments (6)
Attempted to add put_root_layout
to :browser
pipeline in router.ex
as instructed in the changelog.
Getting:
== Compilation error in file lib/live_view_counter_web/router.ex ==
** (CompileError) lib/live_view_counter_web/router.ex: undefined function put_root_layout/2
(elixir 1.10.1) src/elixir_locals.erl:114: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
(stdlib 3.11.2) erl_eval.erl:680: :erl_eval.do_apply/6
There are only 6 Google search results for "phoenix put_root_layout":
https://www.google.com/search?q=phoenix+put_root_layout
I've read through all 6 results and put_root_layout
is a function in the controller.ex
it looks like the Phoenix generator
is about to have a new --live
option as in:
mix phx.new --live
See: phoenixframework/phoenix#3680
That will significantly reduce the number of setup steps.
I'm going to keep my eyes on the phoenix releases https://github.com/phoenixframework/phoenix/releases
and if a new version is released I will revisit this.
from phoenix-liveview-counter-tutorial.
** (exit) an exception was raised:
** (ArgumentError) assign @conn not available in eex template.
Replaced all instances of @conn
in lib/live_view_counter_web/templates/layout/app.html.leex
Now seeing the following error:
[error] GenServer #PID<0.486.0> terminating
** (ArgumentError) :flash is a reserved assign by LiveView and it cannot be set directly. Use the appropriate flash functions instead.
(phoenix_live_view 0.9.0) lib/phoenix_live_view.ex:1425: Phoenix.LiveView.validate_assign_key!/1
(phoenix_live_view 0.9.0) lib/phoenix_live_view.ex:1419: anonymous fn/2 in Phoenix.LiveView.assign/2
(stdlib 3.11.2) maps.erl:232: :maps.fold_1/3
(live_view_counter 0.9.0) lib/live_view_counter_web/live/counter.ex:25: LiveViewCounterWeb.Counter.handle_info/2
(phoenix_live_view 0.9.0) lib/phoenix_live_view/channel.ex:113: Phoenix.LiveView.Channel.handle_info/2
(stdlib 3.11.2) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib 3.11.2) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib 3.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: %Phoenix.Socket.Broadcast{event: "inc", payload: %{flash: %{}, live_view_action: nil, live_view_module: LiveViewCounterWeb.Counter, val: 1}, topic: "live"}
State: %{components: {%{}, %{}, 0}, join_ref: "4", serializer: Phoenix.Socket.V2.JSONSerializer, socket: #Phoenix.LiveView.Socket<assigns: %{flash: %{}, live_view_action: nil, live_view_module: LiveViewCounterWeb.Counter, val: 0}, changed: %{}, endpoint: LiveViewCounterWeb.Endpoint, id: "phx-FfsCpTRMyIBxyQBh", parent_pid: nil, root_pid: #PID<0.486.0>, router: LiveViewCounterWeb.Router, view: LiveViewCounterWeb.Counter, ...>, topic: "lv:phx-FfsCpTRMyIBxyQBh", transport_pid: #PID<0.483.0>, uri: %URI{authority: nil, fragment: nil, host: "localhost", path: nil, port: 4000, query: nil, scheme: "http", userinfo: nil}}
The line in the code is:
%Phoenix.Socket.Broadcast{
event: "inc",
payload: %{
flash: %{},
live_view_action: nil,
live_view_module: LiveViewCounterWeb.Counter,
val: 1
},
topic: "live"
}
After a bit of debugging I figured it out! 🙌
from phoenix-liveview-counter-tutorial.
Fixed in #6
from phoenix-liveview-counter-tutorial.
Reading: https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-live-layouts 👀
from phoenix-liveview-counter-tutorial.
Once #4 is merged we will be able to open an issue on https://github.com/phoenixframework/phoenix_live_view/issues with a full explanation and steps to reproduce!
from phoenix-liveview-counter-tutorial.
Reading: https://github.com/phoenixframework/phoenix_live_view/blob/master/CHANGELOG.md 👀
from phoenix-liveview-counter-tutorial.
Related Issues (20)
- Update to Phoenix 1.7.0 HOT 3
- mix: FunctionClauseError: no function clause matching in String.to_charlist/1 HOT 4
- The project's URL leads to a non-existent Heroku app HOT 6
- Feat: Split `counter.ex` into a basic `LiveView` Component HOT 15
- Chore: Tidy `README.md` Screenshots and Markdown Fails HOT 3
- Opening an issue to be closed :) HOT 6
- Distributed version HOT 7
- Images/assets not loading when running the finished app on my localhost (step 0) HOT 1
- Update "Create the App" section HOT 2
- update readme links
- Add Dependabot to Update Dependencies HOT 1
- 2022 Update HOT 5
- Optimizing User Experience with LiveView HOT 1
- Real-Time Form Validation with Phoenix LiveView HOT 1
- TDD with Liveview HOT 1
- update links
- Why does using handle_call mean the calling LiveView will be updated twice? HOT 3
- Which pubsub? HOT 1
- Learning components
- typo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phoenix-liveview-counter-tutorial.