使用async函数,在webpack打包时报错

babel-polyfill is required. You must also install it in order to get async/await working.

需要加入babel-polyfill

npm i -D babel-polyfill

这里有个小插曲,经测试发现yarn 无法安装css-loader 1.0.0,

而且若先用npm安装完css-loader后用yarn安装其他包也会报错,可用npm安装

在webpack.config.js 的entry选项中

 entry: ['babel-polyfill',join("./src/main.js")],

参考链接:https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined

webpack4 打包报错 :regeneratorRuntime is not defined的更多相关文章

  1. webpack4打包报错ERROR in multi ./src/main.js dist/bundle.js

    webpack打包测试: 上边将mode01.js模块及main.js主文件编写完成,下边使用webpack对这些js文件进行打包 1.进入程序目录,执行webpack main.js build.j ...

  2. webpack4打包报错:WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults fo

    运行命令webpack ./src/main.js ./dist/murenziwei.js后,目录上神马动静都没有,你以为在dist文件夹上会有murenziwei.js吗?毛都没有 警告和错误倒是 ...

  3. vue项目报错webpackJsonp is not defined

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

  4. webpack 打包报错:One CLI for webpack must be installed. These are recommended choices, delivered as separate packages

    webpack 打包报错: One CLI for webpack must be installed. These are recommended choices, delivered as sep ...

  5. 使用vue时,报错“exports is not defined”

    在开发中引用插件时,报错“exports is not defined” 但在引用第三方组件的时候,在浏览器中报错“exports is not defined”.根据浏览器报错信息,查询到报错来源是 ...

  6. 解决xcode10打包报错:That command depends on command in Target ‘xxx’:scrpit phase"[CP] Copy Pods Resources"

    问题:使用xcode10打包报错,提示 error:Multiple commands produce ‘xxxx/xxx.app’ 1)Target ‘xx’ has create director ...

  7. maven install 打包 报错 Cannot run program "gpg.exe": CreateProcess error

    打包报错, mvn install后加上参数-Dgpg.skip,例如:mvn install -Dgpg.skip   即可解决. 我们也可以去掉 这个 插件   <plugin>    ...

  8. koa项目用mongoose与mongodb交互,始终报错FormModel is not defined

    koa项目用mongoose与mongodb交互,始终报错FormModel is not defined,就是自己定义的model实例始终不能找到,但是明明定义了,这时候就要看大小写了,当创建一个m ...

  9. vue-cli 打包报错:Unexpected token: punc (()

    vue-cli 打包报错: ERROR in static/js/vendor.ed7d2353f79d28a69f3d.js from UglifyJs Unexpected token: punc ...

随机推荐

  1. CentOS7自定义系统服务示例

    CentOS7的服务systemctl脚本存放在:/usr/lib/systemd/,有系统(system)和用户(user)之分,需要开机不登陆就能运行的程序,存在系统服务里,即:/usr/lib/ ...

  2. [算法竞赛入门经典]Ancient Cipher, NEERC 2004,UVa1339

    Description Ancient Roman empire had a strong government system with various departments, including ...

  3. Arduino-常用指令

    pinMode(LEDPin,OUTPUT);        //设置引脚模式 参数1      引脚 参数2      OUTPUT  输出:INPUT   输入 用在setup()函数里 digi ...

  4. Thunar 通过快捷键在当前文件夹打开终端

    参考『Keyboard shortcut for open terminal here in thunar』\(^{[1]}\) 在 ganiserb/thunar-terminal 下载脚本. 将脚 ...

  5. python模块------shutil

    说明 shutil -- High-level file operations 是一种高层次的文件操作工具 类似于高级API,而且主要强大之处在于其对文件的复制与删除操作更是比较支持好. copy() ...

  6. window10:jdk 8下载和安装步骤

    window10:jdk 8下载和安装步骤 点击链接:https://blog.csdn.net/qq_39720249/article/details/80721719

  7. 【NLP】依存句法关系符号解释

    今天开始读一篇论文:leveraging linguistic structure for open domain information extraction 于是……重新复习了很多句法分析的内容, ...

  8. spring注解开发AnnotationConfigApplicationContext的使用

    说明 使用AnnotationConfigApplicationContext可以实现基于Java的配置类加载Spring的应用上下文.避免使用application.xml进行配置.相比XML配置, ...

  9. 明确MangoDB在企业中应用

    目录 1.MongoDB是什么? 2.为什么要用MongoDB? 3.主要特性 4.C/S服务模型 5.完善的命令行工具 6.几个shell实操 7.在Java中使用MongoDB 明确MongoDB ...

  10. 算法工程师<深度学习基础>

    <深度学习基础> 卷积神经网络,循环神经网络,LSTM与GRU,梯度消失与梯度爆炸,激活函数,防止过拟合的方法,dropout,batch normalization,各类经典的网络结构, ...