【问题标题】:How to use async await with webpack and typescript in react?如何在反应中使用带有 webpack 和 typescript 的异步等待?
【发布时间】:2021-06-25 17:37:31
【问题描述】:

我收到此错误:regeneratorRuntime 未定义

我的 babel.config.js 文件:

https://www.codepile.net/pile/XqDxeAq6

我的 webpack.config.js 文件

https://www.codepile.net/pile/5ndebjVq

【问题讨论】:

标签: reactjs webpack


【解决方案1】:

安装运行时依赖:

npm i --save-dev @babel/plugin-transform-runtime

将插件添加到您的 babel 配置中:

{
  "plugins": ["@babel/plugin-transform-runtime"]
}

Uncaught ReferenceError: regeneratorRuntime is not defined in React

【讨论】:

  • 具体在哪里?因为我正在使用 webpack
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-06-09
  • 2017-02-19
  • 2023-02-14
  • 2017-09-28
  • 2019-07-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多