Having just upgraded to WP 5.0, post content is not loading in the Gutenberg Classic block for one blog post (other blogs posts loading fine). To start with it was blank; if I switch to code editor, I can view the content, then when I switch back to visual, I get 'This block has encountered an error and cannot be previewed'.
Console error:
media-editor.min.js?ver=5.0:1
Uncaught TypeError: wp.shortcode is not a constructor
There are no shortcodes in the post, just headings, list items, links and a YouTube embed.
I'm using Chrome 70 on Windows 10. The theme is a custom theme based on _s. Please let me know if I can provide more info.
Thanks for the report! What does the YouTube embed in that post look like exactly? Was it just a plain YouTube link added on it's own line?
wp.shortcode is not a constructor sounds suspiciously like a plugin conflict.
Would it be possible to get a list of your other active plugins for reference? And, do you have the Gutenberg plugin installed in addition to WP 5.0? If yes, can you try deleting it to see if that possibly makes a difference? I'm not sure whether it will but thought I'd suggest it just in case.
Thanks for the quick response! I don't have the Gutenberg plugin installed. Active plugins:
Anti-spam
CMB2
GeoIP Detection
Kirki Toolkit
ManageWP - Worker
Post Thumbnail Editor
Post Types Order
WP Featherlight
Yoast SEO
Sorry - forgot to add, yes the YouTube embed is just a plain link on it's own line.
Just wanted to mention I encountered this error at a meetup testing the Gutenberg plugin on an attendee's site back in October. I wasn't able narrow down the cause. It only happened on certain pages and the actual page content didn't seem to make a difference. It was not an _s based theme.
I also just ran into this issue. At the bottom of the post content was a YouTube URL
<p>https://youtu.be/dQw4w9WgXcQ</p>
I updated the post content without the YouTube URL and was able to edit the post, which I then manually added the video as an embed block.
```
```
@petenelson thanks for the note about the workaround you found. Quick question, do you have any of the same active plugins which are listed above?
I tested and am not seeing the problem but may not have the exact same environment for testing that you are working from. I suspect either a strange issue with the content or a conflict with a plugin or theme. Would it be possible for any of you to temporarily deactivate all plugins and check to see if a post you were having trouble with before works normally or if it still doesn't load properly?
@designsimply I'll try to do some testing on a local site that has no plugins installed. This was on a large production site with several plugins, but none of the ones listed above.
I re-tested with the following steps today on a site running WordPress 5.0.2 and no active plugins:
https://www.youtube.com/watch?v=9HUV5a7MgS4 on it's own line into the classic block.Result: the classic editor displays normally in my test, no errors in the console.
Are you able to upgrade to the latest stable version of WordPress (currently 5.0.2) and try again?
Are you able to test with all plugins temporarily deactivated to rule out a plugin conflict?
I tested again locally against a 5.0.2 install with some other plugins enabled and did not have any issues. I manually updated the content of a default post with a YouTube link, rather than creating a new post with blocks.

The site we're having an issue on is WP 4.9.9 and GB 4.7.1. I was able to recreate the issue using the same steps you listed above, but I'm not able to disable all of the plugins since it's a large production multisite, but I have an identical local site so I'll see if I can narrow it down to one of the plugins.
Definitely reproduced it locally with Shortcake Version 0.7.3.
Our new site is Gutenberg, but the Shortcake plugin is network active. We can probably network deactivate it and enable it on specific sites to get around it.
I've just installed 5.0.2 on an existing site (using child theme of Olsen Light 1.2.2). Posts with bare Youtube URLs display as a blank Classic block and can't be edited (also throw the "can't be previewed" error if you try to Edit As HTML). Other posts are OK. There were only three active plugins (wp-cache, UpdraftPlus and Google XML Sitemaps) and deactivating those made no difference. Currently using the Classic Editor plugin as most posts on that site have Youtube links.
ETA: I wasn't expecting the theme to affect the editor, but I just tried switching to TwentySeventeen and Classic block editing now works for all the posts I've tried. Switch back to Olsen Light or my Olsen Light child theme and the Classic blocks are blank again.
ETA #2: I also get the same error as the OP, "Uncaught TypeError: wp.shortcode is not a constructor" .
@petenelson when I install Shortcake 0.7.3 and then open any post, I see the following error but adding a YouTube link on it's own line in the classic editor still seems to work for me in testing using that plugin and the Twenty Seventeen theme. If removing that plugin worked for you in your multisite setup though, that's helpful to know!
Warning: Cannot modify header information - headers already sent by (output started at /srv/users/userfa5165fc/apps/userfa5165fc/public/wp-content/plugins/shortcode-ui/inc/fields/class-shortcode-ui-field-attachment.php:91) in /srv/users/userfa5165fc/apps/userfa5165fc/public/wp-includes/option.php on line 920
@finalcircuit thank you for the theme info! I tested Olsen Light 1.2.2 and can confirm that opening a previously created post with a YouTube embed within a classic block results in the classic block looking blank and the following error in the console:
TypeError: wp.shortcode is not a constructor
Note: a potential workaround I found is that if you click the option in the more menu to "Convert to Blocks" then the content appears.
@hexagongirl may I ask what theme you are using and whether it would be possible for you to temporarily switch to the Twenty Seventeen or Twenty Nineteen theme and also temporarily disable the Kirki Toolkit plugin and check to see if the problem goes away under those conditions?
@designsimply - sorry for being unresponsive on this.
I've now done a bit of testing on a staging site and isolated the issue (in my case at least) to the Post Thumbnail Editor plugin. Not surprising perhaps, as it hasn't been updated for a couple of years.
To replicate:
https://www.youtube.com/watch?v=P6CyTF32K2w on it's own line into the classic blockNotes:
Thank you for the updated testing steps! I tested and confirmed the plugin conflict using WordPress 5.0.3 and Post Thumbnail Editor 2.4.8.
It appears we've uncovered conflicts with:
I reported those issues at:
I couldn't verify the Shortcake (Shortcode UI) 0.7.3 plugin network-activated on a fresh WordPress Multisite 5.0.3 install resulted in the same problem.
I am closing this issue to defer to the plugin and theme authors for these cases. We should continue to report the issue to the plugin/theme authors if it comes up again for other plugins, or we can re-open this issue if we continue to see a large number of report here.