Gatsby preview is not working

Previews won't show, url opens but texts changes wont appear.

Website code:

https://bitbucket.org/karlstensuurna/prismicpreview/src/master/

Site is built with Gatsby

Website is hosted at Netlify:

Build command: gatsby build
Publish: directory public

Prismic Preview settings:

Domain for application:
https://prismicpreview-primefunnel.netlify.app

Link resolver: /preview

Hello Karl, thank you for reaching out. This is a known bug we're currently reviewing.
As soon as we have more information we'll let you know

Thanks

@karl we've found a minor err in our example project's settings, an export default in the wrapRootElement files. Changing this should make the preview work.

Change the code in gatsby-browser.js and gatsby-ssr.js to this:

import * as React from 'react'
import { PreviewStoreProvider } from 'gatsby-source-prismic'

export const wrapRootElement = ({ element }) => (
  <PreviewStoreProvider initialEnabled={true}>{element}</PreviewStoreProvider>
)

Let me know if this works for you

Thanks a lot, now it works :slight_smile:

1 Like

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