Preview opens and says "generating preview" forever (solved by an update form Cloudflare)
Describe the bug Preview doesn't work. About:blank page opens and says "generating preview." Forever.
To Reproduce Steps to reproduce the behavior:
- Create a new post or edit an existing post.
- Click Preview
- In new tab, about:blank page opens with message "Generating preview."
- Preview never appears.
Expected behavior Preview appears.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS 10.13.x
- Browser Chrome, Safari
- Version Latest
Do you see any error in the console of Gutenberg when clicking this button?
[Sorry for my bad english, but I want to support Gutenberg and Wordpress]
It did happen to me too, I can't preview my post. Here is the condition.
Bug Description I can't preview my post (old or new post using Gutenberg). It says "Please wait... Generating Preview". And I wait for so long and the preview won't appear.
Steps to reproduce Simply, create new post or edit existing post with Gutenberg. And try to Preview it using Preview button.
Expected behaviour Just like preview on Classic Editor. I expect to see my post that I create or change and the rest of my site.
Screenshot

My device I'm using Windows 10 with April 2018 Update using Google Chrome latest version (V.68)
I'm really excited with Gutenberg. I hope you guys always keep up the spirit to make Gutenberg better than ever :)
also happening with me some time ago Are you using Cloudflare? I'm (quite) sure this is happening due to the Cloudflare. Whitelist your IP in Cloudflare Firewall. also see #2704
This also happened to my install. It cleared up with the Cloudflare Firewall fix.... if you want to call it a fix.
Here is last known workaround for Cloudflare copied from https://github.com/WordPress/gutenberg/issues/2704#issuecomment-410090933 for reference:
Once you have upgraded your account, you would be able to disable the firewall rule by going to your Firewall page >> selecting Web Application Firewall >> under Cloudflare Rule Set >> click on Cloudflare Wordpress >> Select the rule WP0025B >> set to Disable
The only resolution then, with a free Cloudflare account, is to whitelist all of the IP addresses that will be using the JSON API.
And #2704 also notes that Cloudflare should have an update in place soon.
Thank you for the answer. Yes, I'm using Cloudflare. I rather to wait Cloudflare team to resolve that issue. I'm just ordinary writer of my blog and don't have experience to messed up my Cloudflare setting :( but I do really love and want Gutenberg to be default editor in the coming future.
I hope I can report any issue when I'm writing :)
I hope this issue can be fixed at Cloudflare. I'm also experiencing the same bug with a free Cloudflare account and Gutenberg installed.
See also #7852, #7561, and #6331, and probably many more.
This can also be caused by something else like another plugin. IIRC I had the same issue when using Polylang.
I made this... ;) http://www.ksstradio.com/2017/12/the-gutenberg-cloudflare-free-fix/
Thanks! That works. The downside is that I have to repeat the process every time my IP address changes. That adds a lot of overhead to writing.
Thanks, Bill
"There are two kins of people in the world: those who say to God, "thy will be done," and those to whom God says, "alright, then, have it your way." — C. S. Lewis On Aug 4, 2018, 4:21 PM -0500, abwdvm [email protected], wrote:
I made this... ;) http://www.ksstradio.com/2017/12/the-gutenberg-cloudflare-free-fix/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Cloudflare is working on an update and it should be fixed soon. Here is the latest note I could find on that: https://github.com/WordPress/gutenberg/issues/2704#issuecomment-410563259
I am NOT on Cloudflare and have the same issue. Created a new post, tried to preview and got: "Please wait... Generating Preview" which does not change. Post page says "updating failed". However, if I display all posts, the draft I saved is there. If I click on preview from the All Posts page, that DOES work.
When I attempt to publish it, I receive the message "publishing failed". However, when I return to the All Posts page, the post shows as published.
@KansasEMS I suspect you have a PHP error or warning messing up with the return value (JSON) of the API endpoints. You can open the network tab in your browser's console to check the response of the "autosave"/"save" XHR for instance. Hopefully the content of the response will help debug this.
I didn’t see any errors when I opened the console. Strangely, once I published using the “classic” editor, I can now preview from within Gutenberg. Also, even though it SAYS that updating fails, it appears that the update ACTUALLY happens.
James Kennedy IT Manager Kansas Board of EMS 900 SW Jackson; Suite 1031 Topeka, KS 66612-1228 Office 785.296.7296 Fax 785.296.6212 Email: [email protected]mailto:[email protected]
From: Riad Benguella [email protected] Sent: Wednesday, August 08, 2018 12:13 PM To: WordPress/gutenberg [email protected] Cc: Kennedy, James [BEMS] [email protected]; Mention [email protected] Subject: Re: [WordPress/gutenberg] Preview opens and says "generating preview" forever (Cloudflare) (#8441)
@KansasEMShttps://github.com/KansasEMS I suspect you have a PHP error or warning messing up with the return value (JSON) of the API endpoints. You can open the network tab in your browser's console to check the response of the "autosave"/"save" XHR for instance. Hopefully the content of the response will help debug this.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/WordPress/gutenberg/issues/8441#issuecomment-411482277, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AoQmJm_EwI_apq0kjAZoeCMMZKw9aT2Yks5uOxwOgaJpZM4Vt_vi.
I don't expect errors, but valid XHR response (code 200) with PHP warnings/errors making the JSON in the responses invalid.
Here's how you see the response in Chrome

I will test again later, when I have more time.
James Kennedy IT Manager Kansas Board of EMS 900 SW Jackson; Suite 1031 Topeka, KS 66612-1228 Office 785.296.7296 Fax 785.296.6212 Email: [email protected]mailto:[email protected]
From: Riad Benguella [email protected] Sent: Wednesday, August 08, 2018 12:39 PM To: WordPress/gutenberg [email protected] Cc: Kennedy, James [BEMS] [email protected]; Mention [email protected] Subject: Re: [WordPress/gutenberg] Preview opens and says "generating preview" forever (Cloudflare) (#8441)
I don't expect errors, but valid XHR response (code 200) with PHP warnings/errors making the JSON in the responses invalid.
Here's how you see the response in Chrome
[screen shot 2018-08-08 at 18 37 34]https://user-images.githubusercontent.com/272444/43854237-35a519a6-9b3a-11e8-906f-902e7ca17967.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/WordPress/gutenberg/issues/8441#issuecomment-411490436, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AoQmJoRlN9rELgWjA5oTDVD4JYnVxQ2xks5uOyIbgaJpZM4Vt_vi.
Ok, it looks like Cloudflare fixed the issue, I'm closing this issue for now. Let's see how it plays. To follow the Cloudflare discussions, this issue #2704 is probably a better one.
This may help somebody I had the same issue. I was able to fix it, Fix wordpress “Updating Failed”