Meteor html file compilation issue - Uncaught Error: Target container is not a DOM element

I’m getting the Uncaught Error: Target container is not a DOM element., While rendering the react component and I think it is not the react component issue, It could be the meteor packaging issue. When I was searching the issue caused, I found that we need to need to do following -

  • meteor remove blaze-html-template
  • meteor add static-html

But still I’m getting the above error. Could please help me to resolve this issue ?

1 Like

Hi. I am facing the same problem.

I have just started the “Todo app with React” tutorial and i am blocked because of this error. It occured right after installing React packages to the projet and adding the code until “2.3 Create Task Component”.

I even started the tutorial right from the beginning, but it changed nothing.

" Error: Target container is not a DOM element. " ==> Referring to : <div id=“render-target”></div>

I just run on the same issue, but for me removing blaze-html-templates and adding static-html worked.

1 Like

Thank you JBC !

I have removed and added the package you mentioned and my webbrowser displays the content now. :+1:

Hi. I was facing the same problem.
After trying a lot of good advises I first removed the div in the main.html and used body direct for my target and it worked - but that is not the right way of doing things . So I got the idea that reactDOM could not read the html - so I simple imported the main.html into main.js.-----
import ‘./main.html’;
never faced the problem since :grinning:


This worked for me too, thanks danishfred