javascript - Can't get rid of Uncaught Error: _registerComponent(...): Target container is not a DOM element -
this not new issue, have been reported other users too, problem have tried many solutions not able rid of error, , strangely doesn't cause problem in running app, works fine, why throws error, must doing damage app not able figure out.
following things have tried, nothing works
putting
<script src="/bundle.js"></script>
in end of</body>
tag, after</body>
tag inside</html>
tag.added
type="text/javascript"
1 solution.added
async
in<script>
tag.
moreover have upgraded webpack version 1 latest one, , landed error, come conclusion webpack had bug or, something?
following error stack receiving..
uncaught error: _registercomponent(...): target container not dom
element. @ invariant (12:44) @ object._rendernewrootcomponent
(369:310) @ object._rendersubtreeintocontainer (369:401) at
object.render (369:422) @ eval (729:78) @ object.
(bundle.js?61622f7508eae70357c3:4906) @ webpack_require
(bundle.js?61622f7508eae70357c3:20) @ object.
(bundle.js?61622f7508eae70357c3:4562) @ webpack_require
(bundle.js?61622f7508eae70357c3:20) at
bundle.js?61622f7508eae70357c3:63
the same issue have reported in webpack issue tracker here
my index.html , render function looks 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 helping..
maybe should check mainapp
component, eg, render function of it.
Comments
Post a Comment