dzen

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

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. :tada: At this point you may want to wait on the book until B9 has dropped.

Popular Prag Prog topics Top

New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
EdBorn
Title: Agile Web Development with Rails 7: (page 70) I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New

Other popular topics Top

ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Latest in PragProg

View all threads ❯