在开发中引用插件时,报错“exports is not defined”

但在引用第三方组件的时候,在浏览器中报错“exports is not defined”。
根据浏览器报错信息,查询到报错来源是第三方组件的一段代码:

经过查资料,这是使用了CommonJs写法,而在应用中并没有做相应的模块转换使得浏览器能够识别。而导致这个问题是因为balbel的配置文件.babelrc的问题:

需要改动.babelrc文件即可:

其中{ "modules": false }阻止了babel进行模块转换,所以,将modules改为默认设置即可,或者删除该配置。

然后再次npm run dev即可。

使用vue时,报错“exports is not defined”的更多相关文章

  1. vue项目报错webpackJsonp is not defined

    在vue单页面应用中,我们大概都会使用CommonsChunkPlugin这个插件. 传送门 CommonsChunkPlugin 但是在项目经过本地测试没有任何问题,打包上线后却会报错 webpac ...

  2. vue vue-cli3 修改elementui的date-picker源码 引入node_modules里的element-ui后报错exports is not defined

    报错说明: 1.复制node_modules/element-ui/packages/date-picker里的文件到自己项目里  --------->>>>>>& ...

  3. Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...

  4. Vue.js报错Failed to resolve filter问题原因

    Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...

  5. vue IE 报错 引用babel-polyfill

    一.vue 项目报错 vuex requires a Promise polyfill in this browser     在网上找到下面三篇文章,然而和我的项目都不太一样. 我的项目基于 基础模 ...

  6. 【转】Vue项目报错:Uncaught SyntaxError: Unexpected token <

    这篇文章主要介绍了Vue项目报错:Uncaught SyntaxError: Unexpected token <,在引入第三方依赖的 JS 文件时,遇到的一个问题,小编觉得挺不错的,现在分享给 ...

  7. linux下, 再次遇到使用thinkphp的模板标签时,报错used undefined function \Think\Template\simplexml_load_string() 是因为没有安装 php-xml包

    linux下, 使用thinkphp的模板标签,如 eq, gt, volist defined, present , empty等 标签时, 报错: used undefined function ...

  8. WPF加载Winform窗体时 报错:子控件不能为顶级窗体

    一.wpf项目中引用WindowsFormsIntegration和System.Windows.Forms 二.Form1.Designer.cs 的 partial class Form1 设置为 ...

  9. vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ...

    vue 项目报错,提示:Cannot read property '$createElement' of undefined at render ...

随机推荐

  1. centos7安装git

    1.安装git依赖包 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUti ...

  2. 菜鸟redis初学

    该随笔为本人自学redis所遇到的错误,写这些初衷完全是为了避免以后犯相同的错误,如果对别人有帮助,那就相互促进. 在Java中使用redis,首先你的Jdk要能运行,如果没配置好,网上有很多jdk环 ...

  3. Linux基础命令---mpstat显示cpu使用

    mpstat mpstat指令用来显示cpu的使用状况,将内容显示到标准输出.处理器0是第一个.还报告了所有处理器之间的全球平均活动.mpstat命令既可以在SMP机器上使用,也可以在UP机器上使用, ...

  4. SynchronousQueueDemo

    1.ArrayDeque, (数组双端队列) 2.PriorityQueue, (优先级队列) 3.ConcurrentLinkedQueue, (基于链表的并发队列) 4.DelayQueue, ( ...

  5. Linux编译安装python3

    1.解决编译环境的,依赖环境,必须保证这里正确安装,方可执行后续步骤yum install gcc patch libffi-devel python-devel zlib-devel bzip2-d ...

  6. 用vue脚手架创建bootstrap-vue项目

    用vue脚手架创建bootstrap-vue项目 框架的地址:https://bootstrap-vue.js.org/docs/ 第一步 vue init webpack demo第二步 cd de ...

  7. Java8-对map过滤

    1.对map按值过滤返回值 public class TestMapFilter { public static void main(String[] args) { Map<Integer, ...

  8. BottomNavigationBarItem fixed

    BottomNavigationBar( type: BottomNavigationBarType.fixed, onTap: (value){ if more then 3 items,, use ...

  9. archer docker安装部署

    1.准备配置文件从archer项目官网下载/archer/settings.py文件,根据自己情况放到相应的目录我下载后放到如下目录[root@lenovo opt]# mkdir -p /opt/a ...

  10. 论文笔记:Progressive Neural Architecture Search

    Progressive Neural Architecture Search 2019-03-18 20:28:13 Paper:http://openaccess.thecvf.com/conten ...