Babel unexpected token import when running mocha tests

前端 未结 17 1506
Happy的楠姐
Happy的楠姐 2020-11-27 14:40

The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in my project.

I have two projec

17条回答
  •  借酒劲吻你
    2020-11-27 15:02

    I had {"modules": false} in my .babelrc file, like so:

    "presets": [
        ["es2015", {"modules": false}],
        "stage-2",
        "react"
    ]
    

    which was throwing

    Unexpected token import

    Once i removed it, mocha ran successfully.

提交回复
热议问题