Skip to content
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

Cannot use Preview Webhook URL with Gatsby Refresh Endpoint on Gatsby 3.7.1 #15

Closed
thinkflo opened this issue Jul 6, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@thinkflo
Copy link

thinkflo commented Jul 6, 2021

Description

According to gatsbyjs/gatsby#10328, setting an env var ENABLE_GATSBY_REFRESH_ENDPOINT=true while running gatsby develop will configure the develop server to re-source data when it receives a POST request to /__refresh.

Based on your documentation on setting up LivePreview in local development, this endpoint needs to be added to the Preview Webhook URL of this Helper. However, this triggers a Get Request which will 404 on the development server, since Gatsby will only accepts a Post request.

Steps to reproduce

  1. Install Gatsby 3.7.1 and gatsby-source-graphql 3.8.0
  2. Follow all the steps to setup livePreview
  3. Make changes in livePreview and see all of the /__refresh calls produce 404 errors because they are not Post requests

Additional info

  • Craft version: 3.6.17
  • PHP version: 7.4
  • Database driver & version: mariadb:10.3
  • Plugins & versions: Gatsby Helper 1.0.4
@thinkflo thinkflo added the bug Something isn't working label Jul 6, 2021
@andris-sevcenko
Copy link
Contributor

Can you share your Gatsby Helper settings? The updates are definitely leaving Craft as a POST request (

http.open('POST', "$previewWebhookUrl", true);
)

@andris-sevcenko
Copy link
Contributor

Closing this due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant