I am having an issue where Netlify seems to be stripping the preview context from Nextjs’s 404 page. In my 404.jsx file I have a getStaticProps that will pass down the preview context boolean as a prop for the pages props:
Then in my 404.jsx component itself, I log the props and isPreview is always false when I navigate to the 404 page. It works fine on the home page. I can open the __handlers function and see that the GSProps are being called for the homepage, but the GSProps never get called for the 404 page.
We talked with the engineers and it appears that, we treat the 404 page a little differently which is why it doesn’t show the preview mode. But, the engineers wondered why exactly is this needed? Is there a specific use-case you’re trying to target? Could you talk more about it?
Thank you for getting back. This is needed for me because in the preview mode of pages (including the 404) a user would have an extra form appear needed to be able to change the content on the 404 page.
So when a user is in preview mode on other pages, they can make an edit with that form to edit content. But when navigating to the 404 page to make message or image updates, that form disappears.
Thanks for sharing those extra details with us! We have sent it over to one of our developer teams and we will follow up here once we have more information.