The 404 page is shown in Gatsby develop and in our deploy. However, when I check out a preview I get the following error message:
This is only happening for when I hit the preview button on a "draft" page, but when I create a new update under "website updates" I can preview them correctly.
src/pages/404.tsx
import { withUnpublishedPreview } from 'gatsby-source-prismic';
import * as React from 'react';
import Page from '../templates/Page';
const NotFoundPage = () => (
<main style={pageStyles}>
404
</main>
);
export default withUnpublishedPreview(NotFoundPage, {
templateMap: {
page: Page,
},
});