SSG not pre-fetching data
So I am following the twitter clone video. The profile page is created entirely through static site generation. I really want to understand SSG in general, so why is it that when I try to access the profile page, the Errorpage with the 404 flashes for one second before showing the actual content ? I understant that this is the fallback page which should only show when there is for example no user. Moreover because we use SSG, the user is basically null for a split second. Even in the video and the final code when you refresh the page anywhere you can very briefly see the "Log in" button before the app knows that a user is signed in. But the content of the profile page should be pre-fetched with the ssgHelper. I can't understand why my code shows the errorpage before showing the profile page content. If anyone could help me or at least explain how SSG works, I would really appreciate it.
1 Reply
Here is my code:
nevermind I found the issue. it was some typescript error. I had to do
profile.followers?.length