Preview in production on a statically generated website returns a 404 if the page is not yet been build

Hello,

I have configured Preview for my website and it was working great when I was using "fallback: true" since if the page didn't exist, it would build it and display the content.

However, I had to switch to "fallback: false" since I had some social sharing issues with "fallback: true" (Facebook/Linkedin didn't fetch the correct meta tags). This means that if a page is not been build, it will return 404.

The problem is that if I have not published a page yet, if I go to preview it, it will return a 404 for me. It is not a problem if I have build the page and then preview, then it works great.

Any ideas how I could fix that?

Cheers,
Kris

Hello Kristiyan, thank you for reaching out.

We've responded to a similar thread in the past. In there Fares explains why setting the fallback to true is required for the Previews to work:

If you have any additional questions about this or anything else, let us know.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.