-
Notifications
You must be signed in to change notification settings - Fork 75
Preview mode not working with Gatsby's wrapPageElement #34
Comments
I believe this is actually something we should bring up with Gatsby core. There isn't a good way to replace the props that are passed to pages right now since there is no Gatsby API to do so. In your Gatsby config you could actually try switching the order that |
Hi I'm also using wrapPageElement (for my theme and context providers) and I'm unable to use prismic preview.. Is there any work around to this ? |
I've encountered the same issues as described above while leveraging I'm also very interested in a workaround because I have similar project coming up, where I would like to use the same stack. As a happily paying Prismic.io-customer this issue is unfortunately a show-stopper for me, because it can't live up to my clients expectations of previewing 🤷♂️ I would therefore like to know if the Prismic.io team (cc: @arnaudlewis ) has any interest in fixing this? 🙂 |
I reached out to Prismic.io's customer support who suggested me to set the query as a property of the exported component, like so:
... and previews are now working 😍✌️ |
If I use Gatsby's wrapPageElement, or a plugin that does, like @TylerBarnes gatsby-plugin-transition-link to create a persistent template layout, the Prismic preview mode feature stops working.
When I click the "Preview" button from the CMS with a persistent template setup on my Gatsby site (with
wrapPageElement
), I get the following:Disabling the
gatsby-plugin-transition-link
plugin, or removing the use ofwrapPageElement
in my owngatsby-browser.js
file (as the case may be) restores the preview functionality.gatsby - ^2.3.16
gatsby-source-prismic-graphql - ^3.1.3
EDIT: typos
The text was updated successfully, but these errors were encountered: