WP Preview doesn't work with the filesystem route api
See original GitHub issueFor me neither published posts or drafts ever load when selecting preview from WP. Drafts throw this message:
Published posts basically time out. Tyler I believe you have access to my site to check things out, let me know if you have questions.
If you browse to the preview site directly published posts work fine. Drafts do appear on archive pages but the preview URL is broken: https://preview-moonmeisternet.gtsb.io/generated-preview-path/post/7176/
The only thing somewhat unique about my site that I can think of is the fact that I use the newish file-system routing API for posts.
System:
OS: Linux 4.4 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.15.3 - /tmp/yarn--1608653875235-0.10626545320667291/node
Yarn: 1.22.10 - /tmp/yarn--1608653875235-0.10626545320667291/yarn
npm: 6.14.9 - ~/.nvm/versions/node/v14.15.3/bin/npm
npmPackages:
gatsby: ^2.29.1 => 2.29.1
gatsby-image: ^2.8.0 => 2.8.0
gatsby-plugin-feed: ^2.10.0 => 2.10.0
gatsby-plugin-goatcounter: ^0.4.0 => 0.4.0
gatsby-plugin-linaria: ^2.2.0 => 2.2.0
gatsby-plugin-manifest: ^2.9.0 => 2.9.0
gatsby-plugin-netlify: ^2.8.0 => 2.8.0
gatsby-plugin-offline: ^3.7.0 => 3.7.0
gatsby-plugin-postcss: ^3.4.0 => 3.4.0
gatsby-plugin-preact: ^4.4.0 => 4.4.0
gatsby-plugin-react-helmet: ^3.7.0 => 3.7.0
gatsby-plugin-readingtime: ^1.0.1 => 1.0.1
gatsby-plugin-robots-txt: ^1.5.3 => 1.5.5
gatsby-plugin-sharp: ^2.11.1 => 2.11.1
gatsby-plugin-sitemap: ^2.9.0 => 2.9.0
gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5
gatsby-plugin-webpack-size: ^1.0.0 => 1.0.0
gatsby-source-filesystem: ^2.8.0 => 2.8.0
gatsby-source-wordpress-experimental: * => 6.0.0
gatsby-transformer-sharp: ^2.9.0 => 2.9.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
WP Preview doesn't work with the filesystem route api #29361
For me neither published posts or drafts ever load when selecting preview from WP. Drafts throw this message:
Read more >Adding Custom Endpoints | REST API Handbook
This document details how to create a totally custom route, with its own endpoints. We'll first work through a short example, then expand...
Read more >File System Route API | Gatsby
Use the File System Route API when you want to create dynamic pages e.g. to create individual blog post pages for your blog....
Read more >The Complete Guide to WordPress REST API Basics - Kinsta
The WordPress REST API is set to change the future of WordPress. Learn about the possibilities it offers and how to access it....
Read more >How to Fix WordPress 404 Not Found Error [8 Easy Solutions]
You have changed your URL's permalink structure and haven't redirected the old URL. You don't have file permissions. You have opened an ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @moonmeister , thanks for raising this. It looks like the problem is the filesystem route api only calls onCreatePage when initially creating pages and then never again when updating pages. We will need a fix in Gatsby core for this to work.
Hi!
I’m closing this as a stale issue as in the meantime Gatsby 4 and related packages were released. You can check our Framework Version Support Page to see which versions currently receive active support. If this is a feature request, please create a discussion as we moved feature requests from issues to GitHub Discussions.
Please try the mentioned issue on the latest version (using the
next
tag) and if you still see this problem, open a new bug report. It must include a minimal reproduction.Thanks!