使用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. react native 中时间选择插件

    npm install react-native-datepicker --save import DatePicker from 'react-native-datepicker'; <Vie ...

  2. 内存屏障和volatile内存语义的实现

    趁周末,把以前的书拿出来,再翻一番,顺便做个笔记: 内存屏障:用来控制和规范cpu对内存操作的顺序的cpu指令. 内存屏障列表: 1.loadload:确保“前者数据装载”先于“后者装载指令”: 2. ...

  3. MySQL sum聚合函数

    select sum(if(money > 0, money, 0)) as money   from total_money 意思是如果money > 0, 将money的值累加到tot ...

  4. RLException: XXX is neither a launch file in package XXX nor is XXX a launch file name问题解决

    在运行roslaunch时出现了类似下面的错误: RLException: XXX is neither a launch file in package XXX nor is XXX a launc ...

  5. 开发一个项目之css

    background属性 5+3 image,color,position,repeat,attachment size: 保持纵横比 contain 再发大就cover了 clip:背景绘制区域 b ...

  6. 使用Go语言编写区块链P2P网络(译)(转)

    转自:https://mp.weixin.qq.com/s/2daFH9Ej5fVlWmpsN5HZzw 外文链接: https://medium.com/coinmonks/code-a-simpl ...

  7. 【python】使用flask制作小型页面的关键点总结

    目录结构 app.py web代码 store.db 存储信息的轻量数据库,用的sqlite3 schema.sql 数据库的初始化建表语句 settings.cfg 配置信息 static/styl ...

  8. Scyther-manual ------BNF

    1.Scyther 协议安全模型的验证实例 第一部分:  打开协议模型 ,设置攻击变量的参数执行分析 Scyther  is a tool for the formal analysis o the ...

  9. Linux 允许或者禁止ping

    Linux默认是允许Ping响应的,系统是否允许Ping由2个因素决定的:A.内核参数,B.防火墙,需要2个因素同时允许才能允许Ping,2个因素有任意一个禁Ping就无法Ping. 具体的配置方法如 ...

  10. MVC Bundle生成的css路径问题

    项目是嵌套在主站的一个子站点,结果用CssRewriteUrlTransform来将相对目录路径改成相对网站根目录路径的时候发现少了虚拟目录的路径.最终解决方案: /// <summary> ...