Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Update and Delete Entries

Isa Nolla
Isa Nolla
6,369 Points

Cannot read properties of null ('reading update')

/* Update an article. */
router.post('/:id/edit', asyncHandler(async (req, res) => {
  const article = await Article.findByPk(req.params.id);
  await article.update(req.body)
  res.redirect("/articles/" + article.id);

It's throwing "Cannot read properties of null ('reading update')"

1 Answer

Rohald van Merode
Rohald van Merode
Treehouse Staff

Hi Isa Nolla,

Looking at the code snippet you've shared everything should be working. I tried your code in the finished project files and it's working perfectly on my end. If you're still getting an error there might be something wrong elsewhere in your code. If that is the case please share a snapshot of your workspace and we'd be happy to have another look! 😄

Isa Nolla
Isa Nolla
6,369 Points

I'm using vs code. Is there a way to snapshot that?