What is the error: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'

When a page has been inactive or in the background for a while, and I get back to it, then it repeatedly gets this error printed in the console:

Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'

What does it mean? It seems there’s something going on that I’m not aware about.

This is almost always the result of some browser extension or external javascript modifying the DOM: Elm’s vdom assumes it’s the only thing touching the parts of the DOM it owns (or the whole body, if its a Browser.document)

1 Like

Interesting. I’m using Phoenix channels, and it seems there’s a trigger in phoenix.js that causes trouble. Is that something you’re familiar with?

I’m not really all that familiar with Phoenix or LiveView, but I don know I’ve worked on app that used both Elm and LiveView so presumably it’s possible.

If you’re sure it’s not an extension messing with the DOM, I guess I’d check to make sure that whatever your Phoenix code is doing isn’t messing with anything that Elm controls (so the element you mount your app onto and any of its children).

Here are screenshots of the console:


client_ledger.js and client_db.js are my client files that receive and send json objects over the Phoenix channels. elm_ledger.js and elm_db.js are my compiled Elm front ends.

Don’t think i can help, but it might be helpful to clear something up:

You only wrote

but the next response seemed to assume you were using LiveView building on top of phoenix channels

so now i’m left wondering what exactly is your case:

  • Are you simply using Phoenix channels for communcation with your backend?
  • Or are you using Phoenix LiveView as well as Elm to create a dynamic frontend?

(Just to note: I have successfully used simple phoenix channels to communicate with my backend in Elm without any problems, so i would assume that situation would not cause you problems.)

Hope my confusion is clear and my question makes sense…!

To my knowledge, I’m not using LiveView. I’m currently testing if it’s live reload that’s causing trouble.

1 Like

Recently experienced this same issue bit after adding a datepicker component. Whenever I modified styles, the webapp would begins to crash. Live-reload is a good bet as the error would only happen when I made changes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.