babel 6 async / await: Unexpected token

前端 未结 5 2023
眼角桃花
眼角桃花 2021-02-07 09:33

Im having trouble getting async / await transforms working. What am I missing?

My .babelrc:

{
  \"presets\": [ \"es2015\", \"stage-0\" ]
}
5条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 10:15

    It's recommended to upgrade to Babel 7 and use babel-env as opposed to stages (see here: https://github.com/babel/babel-upgrade).

    There's a command you can use to upgrade accordingly:

    npx babel-upgrade
    

提交回复
热议问题