[英]cypress + lerna: ParseError: 'import' and 'export' may appear only with 'sourceType: module'
I currently started working with cypress.我目前开始使用柏树。 In a test I want to import code from another module but it's saying
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
.在测试中,我想从另一个模块导入代码,但它说
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
中。
I've added the preprocessor like it's described here .我已经添加了这里描述的预处理器。
Here is a repo that's not working.这是一个不起作用的回购。 Cypress is in module
a
and importing a function from module b
.赛普拉斯在模块
a
中并从模块b
导入 function 。
You need to actually install the preprocessor in your project, not just its peer dependencies: npm install --save-dev @cypress/webpack-preprocessor
您需要在项目中实际安装预处理器,而不仅仅是其对等依赖项:
npm install --save-dev @cypress/webpack-preprocessor
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.