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
{{ message }}
Repository navigation
Cannot find node position with custom blocks and shadcn #2106
Describe the bug
There is a rendering error once a a block with a custom schema is in the content and certain Shadcn Components are also rendered:
Uncaught Error: Cannot find node position
at $t (internal.ts:100:11)
at ReactNodeViewRenderer.className (ReactBlockSpec.tsx:265:31)
at Object.react_stack_bottom_frame (react-dom-client.development.js:25904:20)
at renderWithHooks (react-dom-client.development.js:7662:22)
at updateFunctionComponent (react-dom-client.development.js:10166:19)
at beginWork (react-dom-client.development.js:11778:18)
at runWithFiberInDEV (react-dom-client.development.js:871:30)
at performUnitOfWork (react-dom-client.development.js:17641:22)
at workLoopSync (react-dom-client.development.js:17469:41)
at renderRootSync (react-dom-client.development.js:17450:11)
I initially thought that this might have to be connected with portals, as those component per default use portals and which might confuse tiptap / prosemirror's getPos function to resolve the actual elements position after the component that uses portals has rendered.
But even if I remove the portals it does not work and also only with custom blocks.
Hm, this is pretty surprising to me too. For some reason commenting out the shadcn components makes the editor work again. Maybe Prosemirror cannot find the DOM position or something? I didn't see it have an additional render or anything.
Same here !
Error: Cannot find node position
at kt2 (internal.ts:100:11)
at ReactNodeViewRenderer.className (ReactBlockSpec.tsx:265:31)
at Object.react_stack_bottom_frame (react-dom-client.development.js:25904:20)
at renderWithHooks (react-dom-client.development.js:7662:22)
at updateFunctionComponent (react-dom-client.development.js:10166:19)
at beginWork (react-dom-client.development.js:11778:18)
at runWithFiberInDEV (react-dom-client.development.js:871:30)
at performUnitOfWork (react-dom-client.development.js:17641:22)
at workLoopSync (react-dom-client.development.js:17469:41)
at renderRootSync (react-dom-client.development.js:17450:11)
Describe the bug There is a rendering error once a a block with a custom schema is in the content and certain Shadcn Components are also rendered:
Uncaught Error: Cannot find node position
at $t (internal.ts:100:11)
at ReactNodeViewRenderer.className (ReactBlockSpec.tsx:265:31)
at Object.react_stack_bottom_frame (react-dom-client.development.js:25904:20)
at renderWithHooks (react-dom-client.development.js:7662:22)
at updateFunctionComponent (react-dom-client.development.js:10166:19)
at beginWork (react-dom-client.development.js:11778:18)
at runWithFiberInDEV (react-dom-client.development.js:871:30)
at performUnitOfWork (react-dom-client.development.js:17641:22)
at workLoopSync (react-dom-client.development.js:17469:41)
at renderRootSync (react-dom-client.development.js:17450:11)
I initially thought that this might have to be connected with portals, as those component per default use portals and which might confuse tiptap / prosemirror's getPos function to resolve the actual elements position after the component that uses portals has rendered. But even if I remove the portals it does not work and also only with custom blocks.
Sorry the project I am working on is a complex one, with backend services required to be running properly. I will be working on a minimal reproduceble project and will post here when ready.
Activity
mehdigmira commentedon Oct 16, 2025
Same here ! Any workaround would be much appreciated
mehdigmira commentedon Oct 16, 2025
Ok instead of setting initial content, setting it in a
setTimeout(() => editor.replaceBlocks(editor.document, savedContent), 0)seems t be workingnperez0111 commentedon Oct 17, 2025
Hm, this is pretty surprising to me too. For some reason commenting out the shadcn components makes the editor work again. Maybe Prosemirror cannot find the DOM position or something? I didn't see it have an additional render or anything.
@matthewlipski might know more here
kegesch commentedon Oct 27, 2025
@nperez0111 Thank you very much for the fix. It works. But it think something else is now broken, see #2134.
AmayerGogh commentedon Dec 18, 2025
Same here !
Error: Cannot find node position
at kt2 (internal.ts:100:11)
at ReactNodeViewRenderer.className (ReactBlockSpec.tsx:265:31)
at Object.react_stack_bottom_frame (react-dom-client.development.js:25904:20)
at renderWithHooks (react-dom-client.development.js:7662:22)
at updateFunctionComponent (react-dom-client.development.js:10166:19)
at beginWork (react-dom-client.development.js:11778:18)
at runWithFiberInDEV (react-dom-client.development.js:871:30)
at performUnitOfWork (react-dom-client.development.js:17641:22)
at workLoopSync (react-dom-client.development.js:17469:41)
at renderRootSync (react-dom-client.development.js:17450:11)
xu4wang commentedon Dec 20, 2025
Thanks. it works for me..
xu4wang commentedon Dec 20, 2025
It's not related to Shadcn, I'm testing with the Alert Block, https://www.blocknotejs.org/examples/custom-schema/alert-block-full-ux, and encountering the same issue.
YousefED commentedon Dec 20, 2025
@xu4wang could you share a reproducible example, on the latest version of BlockNote?
Best is to provide an online sandbox, click to create one
xu4wang commentedon Dec 20, 2025
Hi @YousefED
please find below the code and my package.json
alert.tsx
package.json
nperez0111 commentedon Dec 20, 2025
@xu4wang, this isn't really a complete example
xu4wang commentedon Dec 21, 2025
Sorry the project I am working on is a complex one, with backend services required to be running properly. I will be working on a minimal reproduceble project and will post here when ready.
spe987-create commentedon Dec 21, 2025
I have the same issue. Everytime I try to load React rendered block, this happens:
My Blocnote package versions:
setTimeout(() => editor.replaceBlocks(editor.document, savedContent), 0)this workaround fixes the issue for me as well.nperez0111 commentedon Jan 8, 2026
We have contributed a change upstream in Tiptap, which we believe should resolve the issue. If you upgrade to the latest version of BlockNote: https://github.com/TypeCellOS/BlockNote/releases/tag/v0.46.0 you should automatically get the latest version of Tiptap with the change.
Please let us know if you continue to have issues