title: Why is this function undefined in Storybook when it's fine in the web app?
body: <p>I've hit an odd issue that I can't understand, whereby a function appears to be undefined within the context of running in Storybook, however it's fine within my application.</p>
  <pre><code>export function createRequest&lt;T&gt;(
      method: Method,
      url: string,
  ): AxiosCancelPromise&lt;T&gt; {
  
      console.log('FOOBAR');
      console.log(createAxiosRequestWithCancel);
  
      ...
  
      return createAxiosRequestWithCancel(method, url);
  }
  </code></pre>
  <p>When I'm running in Storybook I'm hitting the following error:</p>
  <blockquote>
  <p>createAxiosRequestWithCancel is not a function
  at createRequest (axios.ts:88)</p>
  </blockquote>
  <p>This might make sense to be if this were defined elsewhere and there was an issue importing. But <code>createAxiosRequestWithCancel</code> is defined within the same file...</p>
  <pre><code>const createAxiosRequestWithCancel = &lt;T&gt;(
      method: Method,
      url: string,
  ): AxiosCancelPromise&lt;T&gt; =&gt; { ... }
  </code></pre>
  <p>This works absolutetly fine within my application:</p>
  <blockquote>
  <p>axios.ts:84 FOOBAR
  axios.ts:85 (method, url, options = {}) =&gt; {
  const source = axios__WEBPACK_IMPORTED_MODULE_2___default.a.CancelToken.source();
  const promise = axios__WEBPACK_IMPORTED_MODULE_2___default()(Object(_app_node_mo…</p>
  </blockquote>
  <p>But Storybook just thinks it's undefined:</p>
  <blockquote>
  <p>FOOBAR
  axios.ts:85 undefined</p>
  </blockquote>
  <p>Can anyone explain why this oddness might be happening, and also how I might fix or at least workaround the issue? I've not got to mocking requests yet, as I can't get past this hurdle at the moment.</p>