Cannot read property 'content' of undefined

Hello, I recently started using frontity because it looks very good. Unfortunately Iā€™ve came across an error I cannot solve. I wanted to prefetch a post category using beforeSSR so I can display this category on another url. Whenever I use beforeSSR it says on the homepage ā€œCannot read property ā€˜contentā€™ of undefinedā€. This is weird because I also used this method with contact form 7 and that worked just fine. Hopefully you can set me up with a solution.

Thanks in advance

I fixed the beforeSSR issue but now I cannot render the content onto the home page, still gives cannot read property ā€˜contentā€™ of undefined as error

@tieshoenderdos Please post some code or preferably a link to your public repo

thx for your answer but I already solved it!

It would be great if you could share your solution please and tag it as solved as it really helps the rest of the community. Everybody comes up against these same issues all the time.

Even if itā€™s just a case of adding a couple of lines to the settings, or moving a line of code inside a useEffect, it helps clarify how frontity works in real-world cases.

Thanks
J

1 Like