title: How to handle error - "Failed to fetch" in a React app at codesandbox
body: <p>I am building a custom event calendar <code>Component</code> for my Yoga <code>App</code> on <code>codesandbox</code>. Actually I was going to do it on my <code>IDE</code>, but the think started to pick up pretty fast and I ended up using it.</p>
  
  <p>I was trying to get the <code>width</code> and <code>height</code> from a <code>&lt;div/&gt;</code> using <code>ref={(el) =&gt; this.props.testing((this.container = el))</code> then trying to access the dims on <code>componentDidMount()</code>, pretty much like <a href="https://stackoverflow.com/questions/49058890/how-to-get-a-react-components-size-height-width-before-render/49058984">this</a> solution. </p>
  
  <p>Suddenly I started getting the following error on <code>codesandbox</code>: </p>
  
  <pre><code>TypeError
  
  Failed to fetch
  
  This screen is visible only in development. It will not appear if the app crashes in production.
  Open your browser’s developer console to further inspect this error.
  This error overlay is powered by `react-error-overlay` used in `create-react-app`.
  </code></pre>
  
  <p>and on the console: </p>
  
  <pre><code>Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
  
  (index):1 Uncaught (in promise) TypeError: Failed to fetch
  
  (index):1 Access to fetch at 'https://codesandbox.io/api/v1/sandboxes/wm1dl/cache' from origin
  'https://wm1dl.codesandbox.io' has been blocked by CORS policy: Response to preflight request
  doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the
  requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors'
  to fetch the resource with CORS disabled.
  
  codesandbox.io/api/v1/sandboxes/wm1dl/cache:1 Failed to load resource: net::ERR_FAILED
  </code></pre>
  
  <p>I tried inspecting my network, and other stuff, but I don't know how to normalize this.</p>
  
  <p>I need to normalize this, or be at least able to ensure that I could safely copy/commit my files to github then use it on my IDE.</p>
  
  <p>here is my <a href="https://codesandbox.io/embed/continuing-my-agenda-wm1dl?fontsize=14&amp;hidenavigation=1&amp;theme=dark" rel="nofollow noreferrer">sandbox</a></p>