Getting NotFoundError: Failed to execute 'removeChild' on 'Node' on Nextjs app directory
I'm getting the following error when trying to use this package inside the Next.js app directory:
Unhandled Runtime Error: NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."
Link to Sandbox: https://codesandbox.io/p/devbox/quirky-field-5wk4ws?workspaceId=b7a6640e-f073-4ff0-96e4-9ea3e941c70e
@m-Ryan @hulinNeil @mikicho can you please help here?
@n-ryan any updates on this? we have been getting the same error?
@hulinNeil can you please help?
We need this feature to work, it works in the pro mode though
same issue here
Actually fix is quite simple if the library is still under maintaines. Developers should replace
<RenderReactNode
selector={'0'}
node={doc.documentElement}
index={0}
/>
with
<RenderReactNode
selector={'0'}
node={doc.body.children[0] as HTMLElement}
index={0}
/>
Both in HtmlStringToReactNodes.tsx and HtmlStringToPreviewReactNodes.tsx.
That not only will make it work correctly as it will not produce html tag inside of root html tag but also will allow to use the editor in nextjs app router.