Promise.all error inside async function : undefined is not a function

后端 未结 1 1553
情歌与酒
情歌与酒 2021-01-22 15:43

in my async function i use Promise.all but for some reason its not defined or something here is the function

async function check_available_money(         


        
相关标签:
1条回答
  • 2021-01-22 16:17

    Promise.all takes an iterable, not multiple arguments. It tried to iterate your first argument, but that didn't have a [Symbol.iterator] method - "undefined is not a function". Pass an array:

    await Promise.all([
        page.$eval('form', form => form.submit()),
        page.waitForNavigation(),
    ])
    
    0 讨论(0)
提交回复
热议问题