Cypress ParseError: 'import' and 'export' may appear only with 'sourceType: module'

后端 未结 5 1382
星月不相逢
星月不相逢 2021-01-11 14:56

I updated Cypress from 3.0.3 to 3.1.3. Im using ES6 import/export modules which must be working related to docs. But Im getting a line with u

5条回答
  •  长发绾君心
    2021-01-11 15:56

    I solved it, in my root folder was a babel.config.js file which possibly overrode Cypress configs. After I deleted it, everything is working. ¯\_(ツ)_/¯

    Update: Maybe the magic was readd the babel.config.js with this content based on this issue: https://github.com/cypress-io/cypress/issues/2945

    module.exports = process.env.CYPRESS_ENV
      ? {}
      : { presets: ['@vue/babel-preset-app'] }
    

提交回复
热议问题