title: JS/Webpack : Target container is not a DOM element
body: <p>I'm curently building a React JS app and I've this error when I go on the '/' of my project :
  <strong>&quot;Uncaught Error: Target container is not a DOM element.&quot;</strong></p>
  <p>In my project I've some components and few pages, and when I run my server with &quot;npm start&quot; I can't access to my main page.</p>
  <p>My app was build without webpack, I added it after all my components were done.
  <strong>webpack.config.js</strong> :</p>
  <pre><code>const path = require('path');
  module.exports = {
  devServer: {
    historyApiFallback: true
  },
  entry: './src/index.js',
  output: {
      filename: 'main.js',
      path: path.resolve(__dirname, 'dist'),
  },
  module: {
      rules: [
          {
              test:  /\.js$/,
              exclude: /node_modules/,
              loader: 'babel-loader'
          },
          {
              test: /\.css$/,
              use: [
                  'style-loader',
                  'css-loader',
              ]
          },
          {
              test: /\.(png|svg|jpg|gif)$/,
              use: [
                  'file-loader',
              ],
          },
          {
              test: /\.(woff|woff2|eot|ttf|otf)$/,
              use: [
                  'file-loader',
              ],
          }
      ]
  }
  </code></pre>
  <p>};</p>
  <p><strong>index.html</strong> :</p>
  <pre><code>&lt;!DOCTYPE html&gt;
   &lt;html&gt;
    &lt;head&gt;
     &lt;meta charset=&quot;UTF-8&quot;&gt;
     &lt;title&gt;React 101&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
     &lt;div id=&quot;app&quot;&gt;&lt;/div&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;main.js&quot;&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p><strong>.babelrc</strong> :</p>
  <pre><code>{&quot;presets&quot;: [&quot;@babel/preset-env&quot;, &quot;@babel/preset-react&quot;]}
  </code></pre>
  <p><strong>main.js</strong> :</p>
  <pre><code>import React from &quot;react&quot;;
  import ReactDom from &quot;react-dom&quot;;
  
  import App from &quot;./App&quot;;
  
  ReactDom.render(&lt;App /&gt;, document.getElementById('app'));
  </code></pre>
  <p><em>index.js :</em></p>
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import './index.css';
  import '../src/assets/css/bootstrap/css/bootstrap-theme.min.css';
  import '../src/assets/css/bootstrap/css/bootstrap.min.css';
  import App from './App';
  import * as serviceWorker from './serviceWorker';
  
  ReactDOM.render(
    &lt;React.StrictMode&gt;
     &lt;App /&gt;
    &lt;/React.StrictMode&gt;,
   document.getElementById('root')
   );
  serviceWorker.unregister();
  </code></pre>