作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为 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 );
define( 'WP_DEBUG', true );
关于javascript - 如何在 Gutenberg wordpress 中调试 block ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61638746/
我是一名优秀的程序员,十分优秀!