
dzen
Programming Phoenix LiveView B8: Page 20: Bug in instructions
The introduction instructions under section “Build a Simple LiveView” are incomplete. If followed from book one gets the following error:
[error] #PID<0.745.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.659.0>, stream id 9) terminated
Server: localhost:4000 (http)
Request: GET /guess
** (exit) an exception was raised:
** (ArgumentError) no "live" html template defined for PentoWeb.LayoutView
(phoenix_template 1.0.1) lib/phoenix/template.ex:241: Phoenix.Template.render_with_fallback/4
This is because (I think) we put “live.html” in the following line on page 16:
use Phoenix.LiveView, layout: {PentoWeb.LayoutView, "live.html"}
I think it should be changed to/modified to the following:
use Phoenix.LiveView
So the control is directly passed to the render
function, rather than asking it to look for a live.html.
Most Liked

schlenks
What version of phoenix are you using? The current B8 of the book I think is based on phoenix 1.5 and LiveView < 0.18. As a result, there may be a lot of code that is incorrect if you’re using Phoenix 1.7 (the latest release).
@SophieDeBenedetto has mentioned on a few threads that they are just about to release B9 of the book which is being updated for the current versions of Phoenix & LiveView. At this point you may want to wait on the book until B9 has dropped.
Popular Prag Prog topics








Modern Front-End Development for Rails - application does not start after run bin/setup (page xviii)


Modern front-end development for Rails, second edition - Struggling to get the first chapter to work
Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /centos
- /ash
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /lua
- /nodejs
- /slackware
- /julia
- /c
- /neovim