Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Update and Delete Entries

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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
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! 😄

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