0

This is not a new issue, have been reported by other users too, the problem is I have tried many solutions but I am not able to get rid of this error, and strangely it doesn't cause any problem in running the app, all works fine, then why it throws error, is must be doing some damage to the app which I am not able to figure out.

Following are the things I have tried, but nothing works

  1. Putting <script src="/bundle.js"></script> in the end of </body> tag, after </body> tag inside </html> tag.

  2. Added type="text/javascript" which was one the solution.

  3. Added async in <script> tag.

Moreover I have upgraded webpack from version 1 to latest one, and I landed to the this error, I easily come to a conclusion that webpack had some bug or, something?

Following is the error stack I am receiving..

Uncaught Error: _registerComponent(...): Target container is not a DOM

element. at invariant (12:44) at Object._renderNewRootComponent

(369:310) at Object._renderSubtreeIntoContainer (369:401) at

Object.render (369:422) at eval (729:78) at Object.

(bundle.js?61622f7508eae70357c3:4906) at webpack_require

(bundle.js?61622f7508eae70357c3:20) at Object.

(bundle.js?61622f7508eae70357c3:4562) at webpack_require

(bundle.js?61622f7508eae70357c3:20) at

bundle.js?61622f7508eae70357c3:63

The same issue I have reported in webpack issue tracker here

My index.html and render function looks like this

index.html

<!DOCTYPE html>
<html>
  <head>
    <base href="<%= htmlWebpackPlugin.options.baseHref %>">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
  <body>
    <div id="root" class="container-fluid"></div>
  </body>
    <script type="text/javascript" src="/build.js"></script>
</html>

Render

ReactDOM.render(
  <Provider store={store}>
    <MainApp />
  </Provider>
  , document.getElementById('root')
);

Thanks for helping..

Community
  • 1
  • 1
iphonic
  • 12,615
  • 7
  • 60
  • 107

2 Answers2

1

Maybe you should check your MainApp component, eg, the render function of it.

JiangangXiong
  • 2,326
  • 1
  • 12
  • 14
  • Yes it did the trick.. I had `CSSTransitionGroup` added in the component, I removed it the error is gone.. now the question is how to use `CSSTransitionGroup` then? – iphonic Sep 10 '17 at 10:36
  • You can refer to this doc,https://facebook.github.io/react/docs/animation.html,there are some guides and codes. – JiangangXiong Sep 10 '17 at 11:24
0

May be html tag isn't on the DOM where ng-app or ng-... (container) got a problem of writing and doesn't target the dom for output?