Versions
gatsby-source-prismic
: ^6.0.0gatsby-plugin-prismic-previews
: ^6.0.0gatsby
: ^5.11.0- Node.js: v18.16.1
Reproduction
After migrating from version 5 to version 6, the preview for draft pages stopped working. It returns a 404 page. Preview works correctly for published or planned pages. Used this migration documentation - https://github.com/prismicio/prismic-gatsby/blob/4a8f7c7d9a22139b98cf8a3e29f2492173435851/docs/migration-guide-v5-to-v6.md
const About = React.lazy(() => import('pages/about-us'));
export const repositoryConfigs = [
{
repositoryName: process.env.GATSBY_PRISMIC_REPO,
linkResolver,
componentResolver: {
about_page: About,
...
}
}
]
gatsby-browser.js
<PrismicPreviewProvider repositoryConfigs={repositoryConfigs}>
<>
<Analytics />
{element}
</>
</PrismicPreviewProvider>
gatsby-config.js
{
resolve: 'gatsby-plugin-prismic-previews',
options: {
repositoryName: process.env.GATSBY_PRISMIC_REPO,
accessToken: process.env.PRISMIC_ACCESS_TOKEN,
},
},
All pages wraped in to withPrismicPreview
export default withPrismicPreview(About)
Steps to reproduce
Log in to the Prismс dashboard. Open the draft page. Click on the local preview.
What is expected?
Local preview and Gatsby Cloud Preview shows the content of the page.
What is actually happening?
Local preview and Gatsby Cloud Preview shows 404 page.