关于module.exports、require和export、import的混用

1.开发中遇到的报错信息1:

Cannot assign to read only property 'exports' of object '#<Object>' (mix require and export)

google到的报错原因:

You can mix require and export. You can't mix import and module.exports.


#测试通过,报错解决。


2.开发中遇到的报错信息2:

Cannot assign to read only property 'exports' of object '#<Object>'

google到答案:

https://github.com/vuejs/vue-cli/issues/2675

采用解决方案中的

其中,entities设置为了报错文件所在的文件夹。

重启,不再报错。

个人认为解决方案不算很理想,其他解决方案后续调研中。


另,参考https://github.com/webpack/webpack/issues/4039

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容