title: axios request does not receive response or error in lambda function
body: <p>I have a script that works locally but does not work once I put it on Lambda.</p>
  
  <p>There are two functions: <code>playerStatsForAllGamesForPreviousDay</code> and <code>previousDaysGames</code>.</p>
  
  <pre><code>...
  
  const previousDaysGames = async () =&gt; {
  
      const full_games = await axios(
          {
              method: 'get',
              url: `https://api-nba-v1.p.rapidapi.com/games/date/${oneDayBefore}`,
              headers: {
                  'x-rapidapi-host': 'api-nba-v1.p.rapidapi.com',
                  "x-rapidapi-key": 'XXXXXXX'
              }
          }
      ).then((res)=&gt;res.data.api.games.map(game=&gt;game.gameId)).catch(err=&gt;console.log('ERROR',err))
  
      return full_games
  }
  
  ....
  
  const playerStatsForAllGamesForPreviousDay = async () =&gt; {
      console.log('playerStatsForAllGamesForPreviousDay')
      let gameIds = await previousDaysGames()
      console.log(gameIds)
      let promises = []
  
      gameIds.map( async (v)=&gt; {
          promises.push(playerStatsForSpecificGameForPreviousDay(v))
      })
  
      return Promise.all(promises)
          .then((results) =&gt; {
              const flattenedResults = [].concat.apply([], results)
              return flattenedResults
          })
          .catch((errors) =&gt; {
              console.log(errors)
          })
  }
  
  ...
  </code></pre>
  
  <p>There is more to the script then these two functions, but the script runs until <code>playerStatsForAllGamesForPreviousDay</code> calls <code>previousDaysGames</code>; once this happens, the script doesn't go past this point specifically, it doesn't go past <code>const full_games = await axios</code> ; I can tell it doesn't go past this point, because I've put console.logs and deployed to Lambda and looked at the CloudWatch logs.</p>
  
  <p>There is nothing that is returned for an error from the logs, which makes this difficult, and I'm interested in finding out more ways to debug and if anyone has an idea of a solution.</p>