运行项目时报错: 浏览器中: 在运行日志中: 报错原因 使用了commonjs写法,而在应用中并没有做相应的模块转换使得浏览器能够识别。 而导致这个问题是因为 balbel 的配置有问题 解决方法 修改 .babelrc 配置文件: 将 “modules”: false 删除;修改 plugins 中的配置为以下内容:babel: { plugins: ['@babel/plugin-transform-modules-commonjs'], }, ... 参考文章 Uncaught ReferenceError: exports is not defined vue 报错 ReferenceError: exports is not defined