Allow for page build failures to not kill the build #32233
Unanswered
gigaSproule
asked this question in
Ideas / Feature Requests
Replies: 1 comment
-
I love this idea! This happens from time to time to me as well, editors can break the page unintentionally and everyone suddenly gets blocked from preview. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are using Gatsby and Contentful for our websites and our editors need to have a preview functionality. We've started migrating from Netlify to Gatsby Cloud because of this and the performance improvement we get from it.
However, when we have multiple editors working on separate pages in Contentful, previews an be triggered which are then failing because some content is not valid. The scenario being we have some mandatory fields that need to be populated, but for one reason or another, they aren't and can potentially not be updated for a while (editor has to leave for a personal emergency, dragged into a meeting, etc.). This means that editors are unable to view previews of their pages.
For production builds, this is what we would want, so I don't think it would makes sense to change the behaviour by default. But ideally, we'd like to have a flag we can set, that instead of killing the build, we can either catch the error, provide a callback or have the error message printed out as a warning. This would mean our preview builds could still run and the editors aren't blocked, but we can notify/react in some way to pages not being built.
From what I can, see the only options we have are to move all the GraphQL queries to
gatsby-node.js
and catch any errors there, remove all requirements in code to not have expected mandatory fields (causing the code to be littered with null/undefined checks) or to temporarily overrideprocess.exit
, which is a nasty hack.Beta Was this translation helpful? Give feedback.
All reactions