gatsby: Previews URL don't persist across builds with gatsby-source-wordpress
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
When you generate preview for a page or post via Wordpress, Gatsby generates a preview URL
Eg.
https://preview-{yoursitename}.gtsb.io/generated-preview-path/post/2171/
This URL is a temporary path.
Based on @KyleAMathews feedback
it needs to create a redirect once there's a real url
Reproduction Link
https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-wordpress
Steps to Reproduce
- Use a gatsby-source-wordpress example
- Integrate it with WP and Gatsby Cloud
- Create a post and press preview in Wordpress
- Copy url
- Wait few days or just go to Gatsby Cloud -> CMS Preview and press Restart preview
- Open url from step 4, this will result in 404 page
Expected Result
After you press Preview in WP, you should land on the page with a persistent URL that users could share between each other and it will either generate a new preview, or open the latest available version.
Actual Result
Preview url is throwing 404 error after rebuilds, or after some time.
Environment
System:
OS: macOS 12.4
CPU: (8) arm64 Apple M1
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.3.1 - /usr/local/bin/npm
Browsers:
Chrome: 103.0.5060.114
Safari: 15.5
npmPackages:
gatsby: ^4.7.0 => 4.7.0
gatsby-alias-imports: ^1.0.6 => 1.0.6
gatsby-plugin-google-tagmanager: ^4.13.0 => 4.13.0
gatsby-plugin-image: ^2.9.1 => 2.9.1
gatsby-plugin-manifest: ^4.9.1 => 4.9.1
gatsby-plugin-mdx: ^3.9.1 => 3.9.1
gatsby-plugin-postcss: ^5.9.0 => 5.9.0
gatsby-plugin-react-helmet: ^5.9.0 => 5.9.0
gatsby-plugin-sharp: ^4.9.1 => 4.9.1
gatsby-plugin-sitemap: ^5.9.0 => 5.9.0
gatsby-plugin-svgr-svgo: ^2.0.0 => 2.0.0
gatsby-remark-copy-linked-files: ^5.9.0 => 5.9.0
gatsby-remark-images: ^6.9.1 => 6.9.1
gatsby-remark-prismjs: ^6.9.0 => 6.9.0
gatsby-remark-responsive-iframe: ^5.9.0 => 5.9.0
gatsby-remark-video: ^1.2.5 => 1.2.5
gatsby-source-filesystem: ^4.9.1 => 4.9.1
gatsby-transformer-sharp: ^4.9.0 => 4.9.0
Config Flags
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (3 by maintainers)
@TylerBarnes thank you! It’s very sad that there is no work around for this. As I understand that issue exists in every CMS due to current Gatsby architecture. I’m just wondering how other users deal with this, since we get complains about that behavior from different clients.