The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Frank Schmitt (5) [Avatar] Offline
When following the book step-by-step, you get an

Cannot find variable `onClick`

<line number>|         , onClick { operation = "SELECT_PHOTO", data = thumbnail.url }

error after adding the onClick event handler. The fix is to add

 import Html.Events exposing (onClick)

IMHO, this should be mentioned in the section "adding onClick to viewThumbnail" (the same applies to import Html.App in the following section)

UPDATE I'm feeling kind of silly now - the imports are mentioned on the following page in the book, therefore, I'd like to remove this thread. Sorry.
rtfeldman (60) [Avatar] Offline
No worries! smilie Glad it worked out.
Peter Lyons (4) [Avatar] Offline
I agree with OP here. It's very confusing to have a code listing that takes me from working version A to a non-working version, only to find a page later some more code I need to add to get working code again. Adding significant code in the wrong order so it's non-working is a recipe for frustration that when I teach beginner programmers I guide them to avoid. Much higher chances of success if you add small changes keeping a working program as much as possible.

As I read and follow along, it's not clear which changes are ready for testing and which are intermediate, non-runnable steps.