-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用的npm包中引入了 import 'regenerator-runtime/runtime' 构建时报错 #7765
Comments
@soulcm 提供一下 demo 咯 |
babel配置 使用runtime插件以及preset-env, 代码中写上
使用taro/cli工具编译小程序,小程序代码中引入此代码库,将会报上面所描述的错误(编译config中使用官方默认配置) |
没有复现,Taro 内部默认的 webpack 配置是设置了 alias 的:
|
我这边遇到了一个问题,微信小程序编译会报找不到regenerator-runtime/runtime的错,把node_modules/@tarojs/mini-runner/dist/webpack/base.conf.js以及node_modules/@tarojs/webpack5-runner/dist/webpack/MiniBaseConfig.js 的alias的'regenerator-runtime'配置注释掉就可以了,这是什么原因呢? |
相关平台
微信小程序
小程序基础库: 2.13.0
使用框架: React
复现步骤
npm包使用了babel-runtime,编译出的js中包含 import 'regenerator-runtime/runtime'
期望结果
不报错,编译通过
实际结果
变通出错
Module not found: Can't resolve 'regenerator-runtime/runtime' in 'xxxx'
Parsed request is a module
环境信息
The text was updated successfully, but these errors were encountered: