title: Webpack code splitting in NPM package. Error: ChunkLoadError: Loading chunk failed
body: <p>I am trying to make NPM package (from this code <a href="https://github.com/paveli/react-payment-icons-inline" rel="nofollow noreferrer">https://github.com/paveli/react-payment-icons-inline</a>). </p>
  
  <p>In this package I use <a href="https://github.com/paveli/react-payment-icons-inline/blob/7d5c0d9be6268f2256696c518092dfe1356eb928/src/PaymentIcon.jsx#L147" rel="nofollow noreferrer">code splitting with import() syntax</a>.</p>
  
  <p>I’ve tested it in local project (not as a package) and everything worked fine. </p>
  
  <p>Then published to NPM (<a href="https://www.npmjs.com/package/react-payment-icons-inline" rel="nofollow noreferrer">https://www.npmjs.com/package/react-payment-icons-inline</a>) and tried to use it as a dependency in the app created with create-react-app (code: <a href="https://github.com/paveli/react-payment-icons-inline-test" rel="nofollow noreferrer">https://github.com/paveli/react-payment-icons-inline-test</a>).</p>
  
  <p>When I run the app I receive an error: </p>
  
  <pre><code>Uncaught (in promise) Error: ChunkLoadError: Loading chunk 56 failed.
  (missing: http://localhost:3000/56.57c19721fd329317ea9e.js)
      at index.js:494
  </code></pre>
  
  <p>I assume this error is connected to webpack. App can’t access chunks from NPM package. Can anyone please suggest a way to fix it?</p>