title: Getting "Invalid call" when using require with Typescript and Expo
body: <p>I am trying to play some audio in a react-native app created with the expo-cli.</p>
  
  <p>The code is written in typescript and the offending code looks like this, taken from the <a href="https://docs.expo.io/versions/latest/sdk/audio/" rel="noreferrer">expo.io documentation</a>:</p>
  
  <pre><code>import * as React from 'react'
  import { WorkoutComponent } from "./WorkoutExecutor";
  import { Audio } from 'expo';
  
  export default class AudioPlayer {
  
      private async playAudio(fileName: string) {
          console.log("Playing Audio: " + fileName);
          const soundFile = './assets/sounds/' + fileName + '.mp3';
          try {
              const { sound: soundObject, status } = await Audio.Sound.createAsync(
                require(soundFile),
                { shouldPlay: true }
              );
              // Your sound is playing!
            } catch (error) {
                console.log(error);
              // An error occurred!
            }
  
      }
  [...]
  }
  </code></pre>
  
  <p>When the app loads, it gives the following error, even before it gets to the screen with the sound</p>
  
  <pre><code>[...]\src\AudioPlayer.ts:Invalid call at line 13: require(soundFile)
  </code></pre>
  
  <p>I realize that the coe example is with javascript and not typescript, but what am I missing?</p>
  
  <p>My tsconfig.json is the one from the expo typescript example and looks like this</p>
  
  <pre><code>{
    "compilerOptions": {
      "baseUrl": "./src",
      "esModuleInterop": true,
      "experimentalDecorators": true,
      "forceConsistentCasingInFileNames": true,
      "importHelpers": true,
      "jsx": "react-native",
      "module": "es2015",
      "moduleResolution": "node",
      "noEmitHelpers": true,
      "noImplicitReturns": true,
      "noUnusedLocals": true,
      // Using the type definitions in @types/expo becuase they are still better than the ones provided by expo. See SvgScreen.tsx and SystemFontsScreen.tsx.
      "paths": {
        "expo": [
          "../node_modules/@types/expo",
          "../node_modules/expo"
        ],
      },
      "skipLibCheck": true,
      "strict": true,
      "target": "es2017"
    },
    "exclude": [
      "node_modules"
    ]
  }
  </code></pre>