vue 项目启动报错:Cannot assign to read only property 'exports' of object '#'

最近做项目,打开一个新项目,在启动时报错

查询百度结果是

在webpack打包的时候,可以在js文件中混用require和export。但是不能混用import 以及module.exports。

因为webpack 2中不允许混用import和module.exports,

但是在经过我试验之后,发现不起作用,再去百度,发现一个解决办法:

执行npm:

    npm install babel-plugin-transform-es2015-modules-commonjs

然后在 babelrc文件中配置

{ “plugins”: [“transform-es2015-modules-commonjs”] }

 

 

 问题解决啦,感谢百度!大佬一直在,就看你会不会找了~


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#‘的解决方法 vue运行报错error:Cannot assign to read only property 'exports' of object '#' Vue报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object 的解决方法 解决 Cannot assign to read only property 'exports' of object '#' 问题 Cannot assign to read only property 'exports' of object '#' Cannot assign to read only property 'exports' of object '#' Uncaught TypeError: Cannot assign to read only property 'exports' of object '#'
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM