Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting NotFoundError: Failed to execute 'removeChild' on 'Node' on Nextjs app directory #412

Open
itstaranarora opened this issue Sep 10, 2024 · 6 comments

Comments

@itstaranarora
Copy link

itstaranarora commented Sep 10, 2024

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

image

@abhijeetahuja
Copy link

@m-Ryan @hulinNeil @mikicho can you please help here?

@abhijeetahuja
Copy link

@n-ryan any updates on this? we have been getting the same error?

@abhijeet-toptal
Copy link

@hulinNeil can you please help?

@abhijeet-toptal
Copy link

We need this feature to work, it works in the pro mode though

@rossanodr
Copy link

same issue here

@msereniti
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants