-
Notifications
You must be signed in to change notification settings - Fork 75
useStaticQuery hook broken #77
Comments
Also worth noting that this only happens in gatsby prod builds |
I have the same issue. |
Using the component version of StaticQuery fixed this for me. |
I found this |
@arthur-nesterenko I saw that as well, but I assumed it would just not work for prismic sources, not that it would break staticQuery everywhere. At very least this ticket can serve as a warning and tracking for when staticQuery is supported. |
I'm experiencing the same. For some reason, the following repository I found does seem to build while using |
The annoying thing with this is that it also breaks |
This is really a big issue. As much as I'd love to use this plugin these issues make it un-usable. |
I'd love to see this issue resolved. In the meantime this is how I'm getting around it with StaticQuery, as suggested by @greatwitenorth above.
|
what is the solution for this issue? It broke almost all the useStaticQuery of the site. |
@Rutulpatel7077 I gave up :( |
I did too. I'm wondering about the state of this plugin given that there are 61 open issues and 11 PRs |
@pierrenel @tylermcrobert What different approach you have used? It seems really odd that the main plugin does not work. |
@Rutulpatel7077 @pierrenel To be honest with you I just rewrote my app in Next.js. They have a RFC open right now for SSG capabilities so I'm hoping I'll be able to take advantage of that. As much as I love gatsby, I just can't reliably use it with Prismic at this moment. |
@tylermcrobert True. now it seems prismic plugin will not suite properly. |
@tylermcrobert @Rutulpatel7077 I switched the Sanity.io - got the live preview stuff working in a few minutes vs the DAYS I wasted trying to get it to work on Prismic. Prismic is great, I love the slices etc etc, but live preview is a no go. |
Correct! This issue will also make us use something else other than Prismic. |
Hi, |
Ooof. I chose a Gatsby / Prismic / Netlify stack for a large client after doing a number of projects with Rails / Contentful / Heroku. I was really excited about this choice - using React / GraphQL which I have a lot of experience with. I originally chose https://github.com/angeloashmore/gatsby-source-prismic but I need ref support so I migrated to There is so much promise with Gatsby / Prismic. It seems the perfect stack but this, and a raft of other issues, means I will be reluctant to use it on commercial projects in the future. |
Hi guys, actually the issue is tricky because gatsby uses Babel to transform the code at build time and replace all the queries at the component level by an ID and keep a reference only. |
Hi @matthewlein You can use this fork for the time being until a fix on another plugin is merged. |
@MarcMcIntosh Sweet thanks for the update. Apparently I'm in the minority here, but I'm actually totally fine with suboptimal/hacky workarounds for the moment 😅. Let me know when its all set and published on npm somewhere and I'll give it a try.
|
Hi @matthewlein |
🎉confirmed no errors on my tester project! 🎉 |
I am having the exact same issue as described by multiple others above. I was pulling my hair out because everything works perfectly in development, but my production build was totally broken because all of my instances of
This issue is among many other bugs like issue #162 that are making me really really frustrated with this plugin. There are too many hacky workarounds on multiple different fronts for my liking. I tried the fix provided by @MarcMcIntosh and it is working locally with
So... no dice for me 😢 I'm wondering if this plugin is really even being supported anymore with the very low commit volume, the large number of unaddressed Issues and the number of open, but unreviewed, Pull Requests. I really like Prismic, but my dev experience thus far makes me feel like this plugin is definitely not production worthy, especially not for client work. I'll be moving to another alternative to Prismic for future Gatsby projects and may even need to migrate to a different CMS ASAP. |
@codingwithchris FWIW I've gone back to the non-graphQL source, gatsby-source-prismic because of all of the issues you mentioned. It's actively maintained and afaik |
@seaneking I'm probably going to go this route as well at this point. It's definitely a bummer that you have to manually update schema changes though. Auto-generated schemas would be a huge plus! Other than that, migrating seems really simple. Thanks for the rec. |
@codingwithchris Originally they had it auto-generate schemas but they changed it and I believe, the manually updates schema will give you guarantee that your query will not break anyhow even stuff messes up in Prismic. Moreover, it will give you the good version control of the schemas as well which Prismic does not provide. |
This is becoming a dealbreaker for us, is this getting any attention from the team? |
@Danm72 yes this is getting attention from the team. as you might have missed this message, @MarcMcIntosh provided a fix and a new version of the gatsby-source-graphql-universal was released. We now just need to update the dependency of this plugin and it should be fixed. As a part of making this more stable in the future, we also made a pull Request to gatsby in order to have this supported directly in the core project. gatsbyjs/gatsby#23423 |
Awesome thanks for the response, much appreciated. Do you have an ETA on when that update will happen? |
👋 |
Can confirm it's fixed in version 3.6.0. |
Still facing the issue on plugin version |
What version of gatsby are you using? |
Hi @nikpl7777 and @juanpasolano |
- Migrating away from gatsby-source-prismic-graphql due to poor support and continued unadressed stability issues like: birkir/gatsby-source-prismic-graphql#217 birkir/gatsby-source-prismic-graphql#77 birkir/gatsby-source-prismic-graphql#162
* Begin Implementing SEO on Show Pages * Build Re-useable Config Context * Wrap Application in Config Context * Use New Config Context Instead of Direct Static Query * Create Simpler Method for Accessing Context in Our Application * Add Props Validation for Schemas * Move Fragments to GraphQL Root * Add Next Season Variable To Context * Remove Un-needed Index * Improve Destructuring of UseConfig Returned Data * Begin Reorganizing/ Rebuilding Schemas * Update Component To Get Gatsby Compiling * Begin Rebuilding SEO Schema Component Structure * Convert Schema to Typescript * Reorg SEO & New ESLint Configs Project for Project * Remove Errant “S” * Implement Zeit Now & Update All Dependencies * Re-lint All Project FIles * Remove Deprecated NOW Properties * Remove References to SEO — Temp * Prep For Ticket Receipt Email * Migreate Back to Netlify & Remove API Routes * Update Dependencies * Update Readme with Nerve Theatre Data * Clean Up Global Context * Fix File Import Case * Resolve GraphQL Dependency Issue + Update Dependencies Temporarily resolve an issue with `gatsby-source-graphql-universal` dependency: birkir/gatsby-source-graphql-universal#14 * Update Netlify Config with Proper Redirect Value Type * Improve Git Ignore Layout * Temporarily Resolve Broken Functionality * Update Snipcart to 3.0.11 * Remove Duplicate Plugins * Integrate Ascend ESLint Config * Remove Node Engines * Continue Typescript Migration & App Refactor + Move to CSS Variables * Continue Massive Refactor * Add Keys to SSR List items * Remove Invalid Theme Prop * Update Config Query Name * Finish Converting Legacy Components to Typescript * Temp Add Typescript Rule * Add Return Types for Site Config Query * Remove Slices from Season Type * Begin Building Link Map * Build Out Super-Dope Link Map Give us direct access to all site links/pages/shows/seasons etc. Can you feel the power? * Remove All Seasons URL from Node * Set Up Proper Link Map Fallbacks * Temporarily Fix Issue with `gatsby-source-prismic-graphql` Plugin birkir/gatsby-source-prismic-graphql#162 * Refactor Query, Type, & Component Structure * Build Poster Grid & Show Poster Component * Improve Show Poster Stylings * Update Packages To Latest * Completey Convert Codebase to better Gatsby Source Prismic - Migrating away from gatsby-source-prismic-graphql due to poor support and continued unadressed stability issues like: birkir/gatsby-source-prismic-graphql#217 birkir/gatsby-source-prismic-graphql#77 birkir/gatsby-source-prismic-graphql#162 * Upgrade to Snipcart 3.0.15
(moved from #70, which appears to be a separate issue)
3.4.0-beta.1 (and beta.2) seem to break the static query hook.
Which I believe is coming from data.site.siteMetadata.title in src/components/layout.js
Here is a basic repo that reproduces it https://github.com/matthewlein/prismic-gatsby-errors
My changes were:
which you can see all here: matthewlein/prismic-gatsby-errors@5ad2ef9
The text was updated successfully, but these errors were encountered: