Open Bug 1474228 Opened 2 years ago Updated Last year

TypeError: views/book_list.pug: 10 " | (#{book.author.name}) " Cannot read property 'name' of null

Categories

(Developer Documentation :: Learning Area, defect)

All
Other
defect
Not set

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: zsmith126028, Assigned: cmills, NeedInfo)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

There is a TypeError in the code for book_list.pug in line 10. I've copied and pasted the code straight from the tutorial and it's returning an error when I try to load the 'All books' list. The other pages for the tutorial Local Library site are working fine, but the book lists page is not. 

TypeError: \express-locallibrary-tutorial\views\book_list.pug:10
    8|     li 
    9|       a(href=book.url) #{book.title} 
  > 10|       |  (#{book.author.name})
    11|       
    12|   else
    13|     li There are no books.
I think this might be because of an indentation issue. Look at our final version on:

https://github.com/mdn/express-locallibrary-tutorial/blob/master/views/book_list.pug

If you use the exact code form here, does it work better for you?
Assignee: nobody → cmills
Flags: needinfo?(zsmith126028)
You need to log in before you can comment on or make changes to this bug.