I make a website on React.js using a webpack dev server, everything works correctly here. Now I decided to try to just run the index.html file with the linked bundle.js and as a result I get the error in the console: Uncaught Invariant Violation: _registerComponent (...): Target container is not a DOM element.
Html structure:
<body> <div id="container-app"></div> <script src="./build/bundle.js"></script> <script> console.log(document.getElementById('container-app')); </script> </body> Rendered like this:
</Router>, document.getElementById('container-app') console.log (document.getElementById ('container-app')); - gives the container I need. What could be the problem?