New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Previewing with Gatsby cloud is not possible. #5
Comments
Yeah, I'm on it. |
I've fixed the whole |
With the next release of this plugin (soon!) the Gatsby Cloud previews should work. Going forward, the freshly renamed |
Gatsby Helper 1.0.0-beta.2 is out now with this change. |
It's working! 😍 |
Live preview with a self managed development instance works great with the plugin so long as the
ENABLE_GATSBY_REFRESH_ENDPOINT
.env variable is enabled and the preview URL matches what's been set in the plugin settings.However, Gatsby Cloud's Preview service works slightly differently. Instead of exposing the
__refresh
URL to trigger a rebuild of a development site, they instead expect a post request to a randomly generated webhook. This is running on a different domain and so the comparison referenced in the code below will fail.gatsby-helper/src/Plugin.php
Line 176 in a7febe5
Since there is no apparent relation between the webhook URL and the preview URL, there would need to be some other way to identify which preview URL belongs to which webhook. For illustration purposes, a webhook and preview URL might look like this:
URL:
https://preview-PROJECT-SLUG.gtsb.io/
Webhook:
https://webhook.gatsbyjs.com/hooks/data_source/RANDOM-STRING
Secondly, the webhook doesn't expect
__refresh
to be appended to the URL, so this code will generate an invalid URL to send the post hook too.gatsby-helper/src/Plugin.php
Line 166 in a7febe5
The text was updated successfully, but these errors were encountered: