Closed Giulico closed 4 years ago
Hello! Can you precise what other gatsby plugins are you using? Thanks.
Sure. I edited my first post specifying them. Thank you. @veloce
Thanks @Giulico . If I can reproduce this error, maybe I can find a solution.
@veloce I believe the issue is releated to the absence of the props.prismic
object on my pages components. I noticed that if I export my queries as const query
I get the props.prismic
on my pages, otherwise if I export my queries as const pageQuery
I don't get it. Weird, isn't it?
I can not keep const query
because as so, my Layout component is unmounted on each route change. 🤕
As soon as possible I'm going to share a small-size repo as example.
I create a minimun-size repo as example: https://github.com/Giulico/gatsby-prismic-test
Take a look at the console while navigating through the two pages.
Thanks @Giulico ! A min size repo is the best to reproduce and fix the issue. I'll look at it.
@Giulico I still don't know how to fix this but I noticed that in your case loading the gatsby-plugin-layout
after the prismic plugin seems to solve the issue if you also export your page queries as query
. I don't see the layout being unmounted and the preview link is working.
Yeah, this work around works for me too! Thank you @veloce
When I open the preview link I get this error:
gatsby-config.js
I'm using gatsby-source-prismic-graphql 3.6.2