javascript - 如何在 Gutenberg wordpress 中调试 block ?

标签 javascript reactjs wordpress wordpress-gutenberg gutenberg-blocks

我正在为 Gutenberg wordpress 构建一个新块,当我遇到错误时,我不可能知道出了什么问题。有没有调试块的步骤?如何获得有关错误的更多具体信息?

我在 chrome 上有反应开发工具。我进行了搜索,但没有关于 Gutenberg wordpress 调试块的信息。

这是我得到的错误,不知道该怎么办:

react.js?ver=16.9.0:1233 Uncaught Invariant Violation: Objects are not valid as a React child (found: object with keys {icon, upload, swap, remove}). If you meant to render a collection of children, use an array instead.
    in Tooltip (created by edit)
    in div (created by ToolbarGroupContainer)
    in ToolbarGroupContainer (created by ToolbarGroup)
    in ToolbarGroup (created by toolbar_Toolbar)
    in toolbar_Toolbar (created by edit)
    in bubbles_virtually_fill_Fill (created by slot_fill_Fill)
    in slot_fill_Fill (created by BlockControlsFill)
    in BlockControlsFill (created by BlockControlsFill)
    in BlockControlsFill (created by Context.Consumer)
    in IfBlockEditSelected(BlockControlsFill) (created by ForwardRef)
    in ForwardRef (created by edit)
    in div (created by edit)
    in div (created by edit)
    in div (created by edit)
    in section (created by edit)
    in div (created by edit)
    in edit (created by Edit)
    in Edit (created by WithToolbarControls(Edit))
    in WithToolbarControls(Edit) (created by WithInspectorControl(WithToolbarControls(Edit)))
    in WithInspectorControl(WithToolbarControls(Edit)) (created by WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
    in WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))
    in Unknown (created by WithDispatch(Component))
    in WithDispatch(Component)
    in Unknown (created by WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))
    in WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))) (created by WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))
    in WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))) (created by WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))
    in WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))) (created by WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))
    in WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))) (created by WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))
    in WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))) (created by WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))
    in WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))) (created by WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))))
    in WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))) (created by PositioningControl(WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))))
    in PositioningControl(WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))) (created by WithFilters(Edit))
    in WithFilters(Edit) (created by BlockEdit)
    in BlockEdit (created by block_BlockListBlock)
    in BlockCrashBoundary (created by block_BlockListBlock)
    in div (created by ForwardRef)
    in ForwardRef (created by block_BlockListBlock)
    in block_BlockListBlock (created by (block_BlockListBlock))
    in (block_BlockListBlock)
    in Unknown
    in Unknown (created by WithFontSettings((block_BlockListBlock)))
    in WithFontSettings((block_BlockListBlock))
    in Unknown
    in Unknown (created by AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock))))
    in AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))
    in Unknown
    in Unknown (created by AddEditorBlockAttributes(AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))))
    in AddEditorBlockAttributes(AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))) (created by WithFilters(block_BlockListBlock))
    in WithFilters(block_BlockListBlock) (created by IfCondition(WithFilters(block_BlockListBlock)))
    in IfCondition(WithFilters(block_BlockListBlock)) (created by WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
    in WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))
    in Unknown (created by WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))
    in WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
    in Unknown (created by Pure(WithViewportMatch(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))))
    in Pure(WithViewportMatch(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))) (created by BlockList)
    in div (created by ForwardRef(RootContainer))
    in div (created by InsertionPoint)
    in InsertionPoint (created by ForwardRef(RootContainer))
    in ForwardRef(RootContainer) (created by BlockList)
    in BlockList
    in Unknown (created by VisualEditor)
    in div (created by CopyHandler)
    in CopyHandler (created by WithDispatch(CopyHandler))
    in WithDispatch(CopyHandler) (created by VisualEditor)
    in div (created by ObserveTyping)
    in ObserveTyping (created by WithSafeTimeout(ObserveTyping))
    in WithSafeTimeout(ObserveTyping) (created by VisualEditor)
    in div (created by WritingFlow)
    in div (created by WritingFlow)
    in WritingFlow (created by VisualEditor)
    in div (created by CopyHandler)
    in CopyHandler (created by WithDispatch(CopyHandler))
    in WithDispatch(CopyHandler) (created by VisualEditor)
    in div (created by Typewriter)
    in Typewriter
    in Unknown (created by WithSelect(Typewriter))
    in WithSelect(Typewriter) (created by VisualEditor)
    in div (created by BlockSelectionClearer)
    in BlockSelectionClearer (created by WithDispatch(BlockSelectionClearer))
    in WithDispatch(BlockSelectionClearer)
    in Unknown (created by WithSelect(WithDispatch(BlockSelectionClearer)))
    in WithSelect(WithDispatch(BlockSelectionClearer)) (created by VisualEditor)
    in VisualEditor (created by Layout)
    in div (created by EditorSkeleton)
    in div (created by EditorSkeleton)
    in div (created by EditorSkeleton)
    in EditorSkeleton (created by NavigateRegions(EditorSkeleton))
    in div (created by NavigateRegions(EditorSkeleton))
    in NavigateRegions(EditorSkeleton) (created by Layout)
    in div (created by FocusReturnProvider)
    in FocusReturnProvider (created by Layout)
    in Layout (created by Editor)
    in ErrorBoundary (created by Editor)
    in BlockEditorProvider (created by WithDispatch(BlockEditorProvider))
    in WithDispatch(BlockEditorProvider)
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(WithDispatch(BlockEditorProvider)) (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EditorProvider (created by WithDispatch(EditorProvider))
    in WithDispatch(EditorProvider)
    in Unknown (created by WithSelect(WithDispatch(EditorProvider)))
    in WithSelect(WithDispatch(EditorProvider))
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(WithSelect(WithDispatch(EditorProvider))) (created by Editor)
    in div (created by DropZoneProvider)
    in DropZoneProvider (created by Editor)
    in slot_fill_provider_SlotFillProvider (created by SlotFillProvider)
    in SlotFillProvider (created by Editor)
    in StrictMode (created by Editor)
    in Editor (created by WithDispatch(Editor))
    in WithDispatch(Editor)
    in Unknown (created by WithSelect(WithDispatch(Editor)))
    in WithSelect(WithDispatch(Editor))
    at https://tatifrank.com/wp-includes/js/dist/vendor/react.js?ver=16.9.0:1233:30
    at traverseAllChildrenImpl (https://tatifrank.com/wp-includes/js/dist/vendor/react.js?ver=16.9.0:1236:9)
    at traverseAllChildren (https://tatifrank.com/wp-includes/js/dist/vendor/react.js?ver=16.9.0:1264:10)
    at Object.forEachChildren [as forEach] (https://tatifrank.com/wp-includes/js/dist/vendor/react.js?ver=16.9.0:1309:3)
    at https://tatifrank.com/wp-includes/js/dist/element.js?ver=a7bf20c…:884:38
    at Array.reduce (<anonymous>)
    at concatChildren (https://tatifrank.com/wp-includes/js/dist/element.js?ver=a7bf20c…:883:28)
    at Tooltip.render (https://tatifrank.com/wp-includes/js/dist/components.js?ver=90861a4…:10616:92)
    at finishClassComponent (https://tatifrank.com/wp-includes/js/dist/vendor/react-dom.js?ver=16.9.0:17177:31)
    at updateClassComponent (https://tatifrank.com/wp-includes/js/dist/vendor/react-dom.js?ver=16.9.0:17132:24)
(anonymous) @   react.js?ver=16.9.0:1233
traverseAllChildrenImpl @   react.js?ver=16.9.0:1236
traverseAllChildren @   react.js?ver=16.9.0:1264
forEachChildren @   react.js?ver=16.9.0:1309
(anonymous) @   element.js?ver=a7bf2…c65111e966d5592:884
concatChildren  @   element.js?ver=a7bf2…c65111e966d5592:883
render  @   components.js?ver=90…d6750cb7ae6f4:10616
finishClassComponent    @   react-dom.js?ver=16.9.0:17177
updateClassComponent    @   react-dom.js?ver=16.9.0:17132
beginWork$1 @   react-dom.js?ver=16.9.0:18643
callCallback    @   react-dom.js?ver=16.9.0:341
invokeGuardedCallbackDev    @   react-dom.js?ver=16.9.0:391
invokeGuardedCallback   @   react-dom.js?ver=16.9.0:448
beginWork$$1    @   react-dom.js?ver=16.9.0:23355
performUnitOfWork   @   react-dom.js?ver=16.9.0:22346
workLoopSync    @   react-dom.js?ver=16.9.0:22323
renderRoot  @   react-dom.js?ver=16.9.0:22016
runRootCallback @   react-dom.js?ver=16.9.0:21692
(anonymous) @   react-dom.js?ver=16.9.0:11491
unstable_runWithPriority    @   react.js?ver=16.9.0:2820
runWithPriority$2   @   react-dom.js?ver=16.9.0:11443
flushSyncCallbackQueueImpl  @   react-dom.js?ver=16.9.0:11487
flushSyncCallbackQueue  @   react-dom.js?ver=16.9.0:11476
discreteUpdates$1   @   react-dom.js?ver=16.9.0:21815
discreteUpdates @   react-dom.js?ver=16.9.0:2357
dispatchDiscreteEvent   @   react-dom.js?ver=16.9.0:6104
react_devtools_backend.js:6 The above error occurred in the <Tooltip> component:
    in Tooltip (created by edit)
    in div (created by ToolbarGroupContainer)
    in ToolbarGroupContainer (created by ToolbarGroup)
    in ToolbarGroup (created by toolbar_Toolbar)
    in toolbar_Toolbar (created by edit)
    in bubbles_virtually_fill_Fill (created by slot_fill_Fill)
    in slot_fill_Fill (created by BlockControlsFill)
    in BlockControlsFill (created by BlockControlsFill)
    in BlockControlsFill (created by Context.Consumer)
    in IfBlockEditSelected(BlockControlsFill) (created by ForwardRef)
    in ForwardRef (created by edit)
    in div (created by edit)
    in div (created by edit)
    in div (created by edit)
    in section (created by edit)
    in div (created by edit)
    in edit (created by Edit)
    in Edit (created by WithToolbarControls(Edit))
    in WithToolbarControls(Edit) (created by WithInspectorControl(WithToolbarControls(Edit)))
    in WithInspectorControl(WithToolbarControls(Edit)) (created by WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
    in WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))
    in Unknown (created by WithDispatch(Component))
    in WithDispatch(Component)
    in Unknown (created by WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))
    in WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))) (created by WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))
    in WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))) (created by WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))
    in WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))) (created by WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))
    in WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))) (created by WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))
    in WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))) (created by WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))
    in WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))) (created by WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))))
    in WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))))))) (created by PositioningControl(WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))))
    in PositioningControl(WithReplaceImage(WithAdvancedControls(WithAdvancedControls(WithAttributes(WithControls(WithInspectorControl(WithMultipleValidation(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))))))) (created by WithFilters(Edit))
    in WithFilters(Edit) (created by BlockEdit)
    in BlockEdit (created by block_BlockListBlock)
    in BlockCrashBoundary (created by block_BlockListBlock)
    in div (created by ForwardRef)
    in ForwardRef (created by block_BlockListBlock)
    in block_BlockListBlock (created by (block_BlockListBlock))
    in (block_BlockListBlock)
    in Unknown
    in Unknown (created by WithFontSettings((block_BlockListBlock)))
    in WithFontSettings((block_BlockListBlock))
    in Unknown
    in Unknown (created by AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock))))
    in AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))
    in Unknown
    in Unknown (created by AddEditorBlockAttributes(AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))))
    in AddEditorBlockAttributes(AddEditorBlockAttributes(WithFontSettings((block_BlockListBlock)))) (created by WithFilters(block_BlockListBlock))
    in WithFilters(block_BlockListBlock) (created by IfCondition(WithFilters(block_BlockListBlock)))
    in IfCondition(WithFilters(block_BlockListBlock)) (created by WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
    in WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))
    in Unknown (created by WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))
    in WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
    in Unknown (created by Pure(WithViewportMatch(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))))
    in Pure(WithViewportMatch(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))))) (created by BlockList)
    in div (created by ForwardRef(RootContainer))
    in div (created by InsertionPoint)
    in InsertionPoint (created by ForwardRef(RootContainer))
    in ForwardRef(RootContainer) (created by BlockList)
    in BlockList
    in Unknown (created by VisualEditor)
    in div (created by CopyHandler)
    in CopyHandler (created by WithDispatch(CopyHandler))
    in WithDispatch(CopyHandler) (created by VisualEditor)
    in div (created by ObserveTyping)
    in ObserveTyping (created by WithSafeTimeout(ObserveTyping))
    in WithSafeTimeout(ObserveTyping) (created by VisualEditor)
    in div (created by WritingFlow)
    in div (created by WritingFlow)
    in WritingFlow (created by VisualEditor)
    in div (created by CopyHandler)
    in CopyHandler (created by WithDispatch(CopyHandler))
    in WithDispatch(CopyHandler) (created by VisualEditor)
    in div (created by Typewriter)
    in Typewriter
    in Unknown (created by WithSelect(Typewriter))
    in WithSelect(Typewriter) (created by VisualEditor)
    in div (created by BlockSelectionClearer)
    in BlockSelectionClearer (created by WithDispatch(BlockSelectionClearer))
    in WithDispatch(BlockSelectionClearer)
    in Unknown (created by WithSelect(WithDispatch(BlockSelectionClearer)))
    in WithSelect(WithDispatch(BlockSelectionClearer)) (created by VisualEditor)
    in VisualEditor (created by Layout)
    in div (created by EditorSkeleton)
    in div (created by EditorSkeleton)
    in div (created by EditorSkeleton)
    in EditorSkeleton (created by NavigateRegions(EditorSkeleton))
    in div (created by NavigateRegions(EditorSkeleton))
    in NavigateRegions(EditorSkeleton) (created by Layout)
    in div (created by FocusReturnProvider)
    in FocusReturnProvider (created by Layout)
    in Layout (created by Editor)
    in ErrorBoundary (created by Editor)
    in BlockEditorProvider (created by WithDispatch(BlockEditorProvider))
    in WithDispatch(BlockEditorProvider)
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(WithDispatch(BlockEditorProvider)) (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EntityProvider (created by EditorProvider)
    in EditorProvider (created by WithDispatch(EditorProvider))
    in WithDispatch(EditorProvider)
    in Unknown (created by WithSelect(WithDispatch(EditorProvider)))
    in WithSelect(WithDispatch(EditorProvider))
    in Unknown (created by Context.Consumer)
    in WithRegistryProvider(WithSelect(WithDispatch(EditorProvider))) (created by Editor)
    in div (created by DropZoneProvider)
    in DropZoneProvider (created by Editor)
    in slot_fill_provider_SlotFillProvider (created by SlotFillProvider)
    in SlotFillProvider (created by Editor)
    in StrictMode (created by Editor)
    in Editor (created by WithDispatch(Editor))
    in WithDispatch(Editor)
    in Unknown (created by WithSelect(WithDispatch(Editor)))
    in WithSelect(WithDispatch(Editor))

React will try to recreate this component tree from scratch using the error boundary you provided, BlockCrashBoundary.
r @ react_devtools_backend.js:6
logCapturedError @ react-dom.js?ver=16.9.0:19952
logError @ react-dom.js?ver=16.9.0:19988
callback @ react-dom.js?ver=16.9.0:21099
callCallback @ react-dom.js?ver=16.9.0:13067
commitUpdateEffects @ react-dom.js?ver=16.9.0:13106
commitUpdateQueue @ react-dom.js?ver=16.9.0:13097
commitLifeCycles @ react-dom.js?ver=16.9.0:20217
commitLayoutEffects @ react-dom.js?ver=16.9.0:22951
callCallback @ react-dom.js?ver=16.9.0:341
invokeGuardedCallbackDev @ react-dom.js?ver=16.9.0:391
invokeGuardedCallback @ react-dom.js?ver=16.9.0:448
commitRootImpl @ react-dom.js?ver=16.9.0:22723
unstable_runWithPriority @ react.js?ver=16.9.0:2820
runWithPriority$2 @ react-dom.js?ver=16.9.0:11443
commitRoot @ react-dom.js?ver=16.9.0:22552
runRootCallback @ react-dom.js?ver=16.9.0:21692
(anonymous) @ react-dom.js?ver=16.9.0:11491
unstable_runWithPriority @ react.js?ver=16.9.0:2820
runWithPriority$2 @ react-dom.js?ver=16.9.0:11443
flushSyncCallbackQueueImpl @ react-dom.js?ver=16.9.0:11487
flushSyncCallbackQueue @ react-dom.js?ver=16.9.0:11476
discreteUpdates$1 @ react-dom.js?ver=16.9.0:21815
discreteUpdates @ react-dom.js?ver=16.9.0:2357
dispatchDiscreteEvent @ react-dom.js?ver=16.9.0:6104

最佳答案

在 Gutenberg 中调试有几件事:

您已经在浏览器中安装了 react 开发工具 :)

现在在您的 WordPress 安装(您的网站)中,有 wp-config.php。

添加 the following to it :

define( 'SCRIPT_DEBUG', true );

这将加载 WordPress 核心 JS 文件的精简版。
define( 'WP_DEBUG', true );

这将导致显示所有与 php 相关的错误、通知和错误。尽管 Gutenberg 是基于 react 和 javascript,但它在 PHP 中发挥了相当大的作用,如果您正在制作动态块,它尤其有用。不要在生产中使用此设置。

其次,Gutenberg 仍然在进行一些相对较快的变化,它仍然相对较新,并且关于它的文档不是最好的,因此请查看 its issue tracker on github看看其他人是否已经遇到过类似的问题;它可能在较新版本的古腾堡中得到修复。

WordPress 也发布 Gutenberg as a plugin并且该插件的版本比 WordPress 默认包含的版本更新。您可以安装此插件,您的 WordPress 站点将使用较新版本的 Gutenberg,该版本可能已修复问题。

其次,
这似乎是一个非古腾堡特有的 javascript 错误。看起来您只是传递了一个对象,但代码期望的是一个数组,但这可能意味着 few different causes .

我没有看到其余的代码,所以我无法确定或有更多帮助。

关于javascript - 如何在 Gutenberg wordpress 中调试 block ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61638746/

相关文章:

javascript - 如何使用javascript更改具有同一类的多个div的宽度?

javascript - Webpack 不会在 npm run 上生成包文件

reactjs - 从 Redux 迁移到 React Context API + hooks 时如何处理副作用

reactjs - Material-ui 1.0 - 如何创建具有自动完成功能的芯片输入?

apache - 您如何简单地将新的自定义重写添加到 wordpress 的 .htaccess 中而不会失败?

javascript - 如何使悬停在 PNG 中的透明度上不算悬停?

javascript - kendo ui中如何取消选中网格记录

javascript - 理解 Redux 和状态

php - Wordpress 插件执行顺序

php - WordPress 图片库的自定义 HTML,仅输出一半功能