博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
未定义符号错误_包裹,如何修复“ regeneratorRuntime未定义”错误
阅读量:2509 次
发布时间:2019-05-11

本文共 1347 字,大约阅读时间需要 4 分钟。

未定义符号错误

I run into this problem in a project using as soon as I added an async function, but the problem is the same for any recent JavaScript feature:

添加async功能后,我立即在使用的项目中遇到了这个问题,但是最近的任何JavaScript功能都存在相同的问题:

Babel, used by , generates a polyfill, but to avoid this error you need to also load the regenerator-runtime runtime.

使用的Babel生成一个polyfill,但是要避免此错误,您还需要加载regenerator-runtime运行时。

One solution: add to the top of your main JavaScript file:

一种解决方案:添加到主JavaScript文件的顶部:

import 'regenerator-runtime/runtime'

Parcel will include this package by default, increasing the size of 25KB.

默认情况下,Parcel将包括此软件包,增加25KB的大小。

The solution that is the most efficient in terms of codebase is adding the browserslist property to your package.json.

就代码库而言,最有效的解决方案是将browserslist属性添加到package.json。

For example:

例如:

"browserslist": [  "last 1 Chrome version"]

For testing is good enough. To support multiple browsers:

对于测试已经足够了。 要支持多种浏览器:

"browserslist": [  "last 3 and_chr versions",  "last 3 chrome versions",  "last 3 opera versions",  "last 3 ios_saf versions",  "last 3 safari versions"]

or also:

或者:

"browserslist": [  "since 2017-06"]

You have to add a version that’s recent enough to support async/await, so Babel does not try to add a polyfill.

您必须添加最新的版本以支持async/await ,因此Babel不会尝试添加polyfill。

Check all the valid values here:

在此处检查所有有效值: :

翻译自:

未定义符号错误

转载地址:http://pmmgb.baihongyu.com/

你可能感兴趣的文章
Chapter 3 Phenomenon——9
查看>>
win64 Python下安装PIL出错解决2.7版本 (3.6版本可以使用)
查看>>
获取各种类型的节点
查看>>
表达式求值-201308081712.txt
查看>>
centos中安装tomcat6
查看>>
从Vue.js窥探前端行业
查看>>
学习进度
查看>>
poj3368 RMQ
查看>>
“此人不存在”
查看>>
github.com加速节点
查看>>
解密zend-PHP凤凰源码程序
查看>>
python3 序列分片记录
查看>>
Atitit.git的存储结构and 追踪
查看>>
atitit 读书与获取知识资料的attilax的总结.docx
查看>>
B站 React教程笔记day2(3)React-Redux
查看>>
找了一个api管理工具
查看>>
C++——string类和标准模板库
查看>>
zt C++ list 类学习笔记
查看>>
git常用命令
查看>>
探讨和比较Java和_NET的序列化_Serialization_框架
查看>>