You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using editor.blocksToFullHTML you get errors when your blocks include an Image block.
The error is different depending on if you are using client side useCreateBlockNote or serverside ServerBlockNoteEditor.create()
On the server side attempting to use blocksToFullHTML if the blocks contains an Image block causes the server to crash with the following error.
TypeError: Cannot read properties of undefined (reading 'view')
at get domElement [as domElement] (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:7:59473)
at Object.Et [as render] (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:22136)
at toInternalHTML (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:10378)
at Xe (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:3036)
at i.serializeNodeInner (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:5776)
at /project/workspace/node_modules/prosemirror-model/dist/index.cjs:2707:32
at Fragment.forEach (/project/workspace/node_modules/prosemirror-model/dist/index.cjs:229:9)
at DOMSerializer.serializeFragment (/project/workspace/node_modules/prosemirror-model/dist/index.cjs:2682:16)
at Xe (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:3379)
at i.serializeNodeInner (/project/workspace/node_modules/@blocknote/core/dist/blocknote.umd.cjs:5:5776)
This is because editor.domElement is undefined when using the server function, but we use it to calculate some widths. We should rethink how we can best solve this (and add tests)
Describe the bug
When using
editor.blocksToFullHTML
you get errors when your blocks include an Image block.The error is different depending on if you are using client side
useCreateBlockNote
or serversideServerBlockNoteEditor.create()
Given the following editor blocks
On the server side attempting to use
blocksToFullHTML
if the blocks contains an Image block causes the server to crash with the following error.On the client side the html rendered is
This doesn't appropriately apply the src to the
img
element and so you end up with a broken image.To Reproduce
A client side example can be found here.
A server side example can be found here.
Misc
The text was updated successfully, but these errors were encountered: