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,
},
});
Hello, thanks for reaching out.
I've seen this error commonly because an alternate value in the templateMap is missing, add the prismicPage option to your code: