Wordpress gutenberg 自定义块——预览加载问题
Wordpress gutenberg custom block — issues with preview loading
我创建了一个带有自定义块的插件。我在块预览方面遇到问题。当我将块设置为预览模式并重新加载页面编辑器时 — 我在预览的所有块上收到一条错误消息 Error loading block: You are probably offline.
在控制台中我也收到以下错误:
pd-admin.js?ver=2.20:12 Uncaught TypeError: jQuery(...).live is not a function
Failed to load resource: net::ERR_CONNECTION_CLOSED
wp-auth-check.min.js?ver=5.5:2 Uncaught TypeError: Cannot read property 'hasClass' of undefined
知道我正在做什么导致这种情况吗?
我发现 RichText
字段有问题 — 如果 RichText
太长,我根本无法预览块,并且在块中我收到相同的错误消息 Error loading block: You are probably offline.
修复控制台错误:WordPress 5.5 停止使用 jQuery 迁移。此更改导致旧插件和主题出现问题。如果您在升级到 WordPress 5.5 后发现问题,安装此插件可能会解决问题:https://wordpress.org/plugins/enable-jquery-migrate-helper/
对于RichText
长文本错误,您需要在您的apache 配置中增加LimitRequestLine
。参考:how to increase Apache 2 uri length limit
我创建了一个带有自定义块的插件。我在块预览方面遇到问题。当我将块设置为预览模式并重新加载页面编辑器时 — 我在预览的所有块上收到一条错误消息 Error loading block: You are probably offline.
在控制台中我也收到以下错误:
pd-admin.js?ver=2.20:12 Uncaught TypeError: jQuery(...).live is not a function
Failed to load resource: net::ERR_CONNECTION_CLOSED
wp-auth-check.min.js?ver=5.5:2 Uncaught TypeError: Cannot read property 'hasClass' of undefined
知道我正在做什么导致这种情况吗?
我发现 RichText
字段有问题 — 如果 RichText
太长,我根本无法预览块,并且在块中我收到相同的错误消息 Error loading block: You are probably offline.
修复控制台错误:WordPress 5.5 停止使用 jQuery 迁移。此更改导致旧插件和主题出现问题。如果您在升级到 WordPress 5.5 后发现问题,安装此插件可能会解决问题:https://wordpress.org/plugins/enable-jquery-migrate-helper/
对于RichText
长文本错误,您需要在您的apache 配置中增加LimitRequestLine
。参考:how to increase Apache 2 uri length limit