title: Webpack code splitting: ChunkLoadError - Loading chunk X failed, but the chunk exists
body: <p>I've integrated Sentry with my website a few days ago and I noticed that sometimes users receive this error in their console:</p>
  <pre><code>ChunkLoadError: Loading chunk &lt;CHUNK_NAME&gt; failed.
  (error: &lt;WEBSITE_PATH&gt;/&lt;CHUNK_NAME&gt;-&lt;CHUNK_HASH&gt;.js)
  </code></pre>
  <p>So I investigated the issue around the web and discovered some similar cases, but related to missing chunks caused by release updates during a session or caching issues.</p>
  <p>The main difference between these cases and mine is that the failed chunks are actually reachable from the browser, so the loading error does not depend on the after-release refresh of the chunk hashes but <em>(I guess)</em>, from some network related issue.
  This assumption is reinforced by this stat: <strong>around 90% of the devices involved are mobile</strong>.</p>
  <p><strong>Finally, I come to the question</strong>: Should I manage the issue in some way <em>(e. g. retrying the chunk loading if failed)</em> or it's better to simply ignore it and let the user refresh manually?</p>
  <hr />
  <p>2021.09.28 edit:</p>
  <p>A month later, the issue is still occurring but I have not received any report from users, also I'm constantly recording user sessions with Hotjar but nothing relevant has been noticed so far.</p>
  <p>I recently had a chat with Sentry support that helped me <strong>excluding the network related hypotesis</strong>:</p>
  <blockquote>
  <p>Our React SDK does not have offline cache by default, when an error is captured it will be sent at that point. If the app is not able to connect to Sentry to send the event, it will be discarded and the SDK will no try to send it again.</p>
  <p><em>Rodolfo from Sentry</em></p>
  </blockquote>
  <p>I can confirm that the issue is quite unusual, I share with you another interesting stat: the user affected since the first occurrence are <strong>882 out of 332.227 unique visitors (~0,26%)</strong>, but I noticed that <strong>the 90% of the occurrences are from iOS</strong> (not generic mobile devices as I noticed a month ago), so if I calculate the same proportion with iOS users (794 (90% of 882) out of 128.444) we are near to a 0,62%. Still small but definitely more relevant on iOS.</p>