title: IE11 Blank Page with React, Typescript, Babel, and Webpack
body: <p>I have a React application written in Typescript with Babel and Webpack.  It loads fine in Firefox and Chrome, but loads a blank page in Internet Explorer 11.  I am new to this project with relatively low experience with React/Babel/WebPack/Typescript.  I need to make the app work with IE11.  I've spent a couple days learning about what I'm working with and trying different approaches that I've found on the web, but have not found a solution yet.  Based on what I am working with that I have posted below, I'm hoping this fine community can help me find a solution to get this loading in IE11.  I need to get this working in prod, but development is less of a concern.</p>
  <p>Relevant stuff from package.json</p>
  <pre><code>.
  .
    &quot;scripts&quot;: {
      &quot;build&quot;: &quot;eslint './**' &amp;&amp; npm run clean-dist &amp;&amp; webpack -p --config=configs/webpack/prod.js&quot;,
      &quot;clean-dist&quot;: &quot;rm -f -r -d dist&quot;,
      &quot;lint&quot;: &quot;eslint './**'&quot;,
      &quot;start&quot;: &quot;npm run start-dev&quot;,
      &quot;start-dev&quot;: &quot;webpack-dev-server --config=configs/webpack/dev.js&quot;,
      &quot;test&quot;: &quot;jest --watch --coverage --config=configs/jest.json&quot;,
      &quot;prettier&quot;: &quot;prettier 'src/**/*.{ts,tsx}' --check&quot;,
      &quot;prettier:fix&quot;: &quot;prettier 'src/**/*.{ts,tsx}' --write&quot;,
      &quot;createVersionFile&quot;: &quot;node ./bin/createVersionFile.js&quot;
    },
    .
    .
    &quot;devDependencies&quot;: {
      &quot;@babel/cli&quot;: &quot;^7.2.3&quot;,
      &quot;@babel/core&quot;: &quot;^7.3.4&quot;,
      &quot;@babel/preset-env&quot;: &quot;^7.3.4&quot;,
      &quot;@babel/preset-react&quot;: &quot;^7.0.0&quot;,
      .
      .
      &quot;@types/node&quot;: &quot;^11.9.6&quot;,
      &quot;@types/react&quot;: &quot;^16.9.35&quot;,
      &quot;@types/react-dom&quot;: &quot;^16.9.8&quot;,
      &quot;@types/react-intl&quot;: &quot;^2.3.17&quot;,
      &quot;@types/react-redux&quot;: &quot;^7.1.9&quot;,
      &quot;@types/react-router&quot;: &quot;^5.1.7&quot;,
      &quot;@types/react-router-dom&quot;: &quot;^5.1.5&quot;,
      &quot;@types/react-test-renderer&quot;: &quot;^16.9.1&quot;,
      .
      .
      &quot;babel-jest&quot;: &quot;^24.1.0&quot;,
      &quot;babel-loader&quot;: &quot;^8.0.5&quot;,
      &quot;babel-plugin-react-intl&quot;: &quot;^3.0.1&quot;,
      &quot;copy-webpack-plugin&quot;: &quot;^5.1.1&quot;,
      .
      .
      &quot;webpack-cli&quot;: &quot;^3.2.3&quot;,
      &quot;webpack-dev-middleware&quot;: &quot;^3.6.0&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.2.1&quot;,
      &quot;webpack-merge&quot;: &quot;^4.2.1&quot;
    },
      dependencies&quot;: {
      &quot;babel-plugin-transform-regenerator&quot;: &quot;^6.26.0&quot;,
      &quot;babel-polyfill&quot;: &quot;^6.26.0&quot;,
      .
      .
      &quot;react&quot;: &quot;^16.12.0&quot;,
      &quot;react-dom&quot;: &quot;^16.12.0&quot;,
      &quot;react-dropzone&quot;: &quot;^11.0.3&quot;,
      &quot;react-intl&quot;: &quot;^2.8.0&quot;,
      &quot;react-redux&quot;: &quot;^7.2.0&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
    }
  </code></pre>
  <p>.bablerc</p>
  <pre><code>{
    &quot;presets&quot;: [
      [&quot;@babel/preset-env&quot;, {&quot;modules&quot;: false}],
      &quot;@babel/preset-react&quot;
    ],
    &quot;plugins&quot;: [&quot;react-hot-loader/babel&quot;, &quot;transform-regenerator&quot;],
    &quot;env&quot;: {
      &quot;production&quot;: {
        &quot;presets&quot;: [&quot;minify&quot;]
      },
      &quot;test&quot;: {
        &quot;presets&quot;: [&quot;@babel/preset-env&quot;, &quot;@babel/preset-react&quot;]
      }
    }
  }
  </code></pre>
  <p>tsconfig.json</p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;experimentalDecorators&quot;: true,
      &quot;outDir&quot;: &quot;./dist/&quot;,
      &quot;sourceMap&quot;: true,
      &quot;noImplicitAny&quot;: true,
      &quot;noImplicitThis&quot;: true,
      &quot;alwaysStrict&quot;: true,
      &quot;strictNullChecks&quot;: true,
      &quot;strict&quot;: true,
      &quot;suppressImplicitAnyIndexErrors&quot;: true,
      &quot;module&quot;: &quot;commonjs&quot;,
      &quot;target&quot;: &quot;es6&quot;,
      &quot;jsx&quot;: &quot;react&quot;,
      &quot;lib&quot;: [
        &quot;es5&quot;,
        &quot;es6&quot;,
        &quot;es2019&quot;,
        &quot;dom&quot;
      ],
      &quot;baseUrl&quot;: &quot;./&quot;,
      &quot;paths&quot;: {
        &quot;*&quot; : [&quot;src/@types/*&quot;]
      },
      &quot;resolveJsonModule&quot;: true,
      &quot;esModuleInterop&quot;: true
    },
    &quot;include&quot;: [
      &quot;./src/**/*&quot;,
      &quot;./tests/*&quot;
    ],
    &quot;awesomeTypescriptLoaderOptions&quot;: {
      &quot;reportFiles&quot;: [
        &quot;./src/**/*&quot;
      ]
    },
    &quot;exclude&quot;: [
      &quot;node_modules&quot;
    ]
  }
  </code></pre>
  <p>We have separate Webpack configs for prod and dev.  They both import some common configurations.  This is the relevant part of the common config used by both prod and dev Webpack configs:</p>
  <pre><code>// shared config (dev and prod)
  const {resolve} = require('path');
  const {CheckerPlugin} = require('awesome-typescript-loader');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const Dotenv = require('dotenv-webpack');
  
  module.exports = {
      resolve: {
          extensions: ['.ts', '.tsx', '.js', '.jsx'],
      },
      context: resolve(__dirname, '../../src'),
      module: {
          rules: [
              {
                  test: /\.js$/,
                  use: ['babel-loader', 'source-map-loader'],
                  exclude: /node_modules/,
              },
              {
                  test: /\.tsx?$/,
                  use: ['babel-loader', 'awesome-typescript-loader'],
              },
              .
              .
  
          ],
      },
      .
      .
  };
  </code></pre>
  <p>Dev specific Webpack config:</p>
  <pre><code>const merge = require('webpack-merge');
  const webpack = require('webpack');
  const commonConfig = require('./common');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  
  module.exports = merge(commonConfig, {
    mode: 'development',
    entry: [
      'react-hot-loader/patch', // activate HMR for React
      'webpack-dev-server/client?http://localhost:8081',// bundle the client for webpack-dev-server and connect to the provided endpoint
      'webpack/hot/only-dev-server', // bundle the client for hot reloading, only- means to only hot reload for successful updates
      'babel-polyfill',
      './index.tsx' // the entry point of our app
    ],
    output: {
      publicPath: '/iq-customize'
    },
    devServer: {
      //historyApiFallback: true,
      //contentBase: './',
      hot: true, // enable HMR on the server
      port: 8081
    },
    devtool: 'cheap-module-eval-source-map',
    plugins: [
      new webpack.HotModuleReplacementPlugin(), // enable HMR globally
      new webpack.NamedModulesPlugin(), // prints more readable module names in the browser console on HMR updates
      new CopyWebpackPlugin([
        { from: '../public', to: 'public' },
      ]),
    ],
  });
  </code></pre>
  <p>Prod specific Webpack config:</p>
  <pre><code>const merge = require('webpack-merge');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const {resolve} = require('path');
  
  const commonConfig = require('./common');
  
  module.exports = merge(commonConfig, {
    mode: 'production',
    entry: './index.tsx',
    output: {
      filename: 'js/bundle.[hash].min.js',
      path: resolve(__dirname, '../../dist'),
      publicPath: '/iq-customize/',
    },
    devtool: 'source-map',
    plugins: [
      new CopyWebpackPlugin([
        { from: '../public', to: 'public' },
      ]),
    ],
  });
  </code></pre>
  <p>index.tsx</p>
  <pre><code>import &quot;babel-polyfill&quot;;
  import * as React from &quot;react&quot;;
  import * as ReactDOM from &quot;react-dom&quot;;
  import { BrowserRouter } from &quot;react-router-dom&quot;;
  import { Provider } from &quot;react-redux&quot;;
  import DateFnsUtils from &quot;@date-io/date-fns&quot;;
  import { MuiPickersUtilsProvider } from &quot;@material-ui/pickers&quot;;
  import registerServiceWorker from &quot;./registerServiceWorker&quot;;
  import { ThemeProvider } from &quot;@material-ui/core&quot;;
  
  import App from &quot;./App&quot;;
  import store from &quot;./modules/shared/store/store&quot;;
  import { theme } from &quot;./modules/shared/common/Theme&quot;;
  
  const app = (
      &lt;Provider store={store}&gt;
          &lt;BrowserRouter basename=&quot;/xxxxx&quot;&gt;
              &lt;MuiPickersUtilsProvider utils={DateFnsUtils}&gt;
                  &lt;ThemeProvider theme={theme}&gt;
                      &lt;App /&gt;
                  &lt;/ThemeProvider&gt;
              &lt;/MuiPickersUtilsProvider&gt;
          &lt;/BrowserRouter&gt;
      &lt;/Provider&gt;
  );
  
  ReactDOM.render(app, document.getElementById(&quot;root&quot;) || document.createElement(&quot;div&quot;));
  registerServiceWorker();
  </code></pre>