compil3
TTCTheo's Typesafe Cult
•Created by compil3 on 9/17/2023 in #questions
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.
7 replies