Skip to content
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

2.0.0-beta.13版本 "polyfill": true 开启报错 #5245

Closed
spencer17x opened this issue Jan 5, 2020 · 5 comments
Closed

2.0.0-beta.13版本 "polyfill": true 开启报错 #5245

spencer17x opened this issue Jan 5, 2020 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@spencer17x
Copy link
Contributor

问题描述

config/index.js babel 配置开启 polyfill 报错,提示$export is not a function

babel: {
sourceMap: true,
presets: [
['env', {
modules: false
}]
],
plugins: [
'transform-decorators-legacy',
'transform-class-properties',
'transform-object-rest-spread',
['transform-runtime', {
"helpers": false,
"polyfill": true,
"regenerator": true,
"moduleName": 'babel-runtime'
}]
]
},

版本

👽 Taro v2.0.0-beta.13

Taro CLI 2.0.0-beta.13 environment info:
System:
OS: macOS 10.15.2
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
npmPackages:
@tarojs/components: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/components-qa: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/mini-runner: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/mobx: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/mobx-h5: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/router: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-alipay: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-h5: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-qq: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-quickapp: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-swan: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-tt: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/taro-weapp: 2.0.0-beta.13 => 2.0.0-beta.13
@tarojs/webpack-runner: 2.0.0-beta.13 => 2.0.0-beta.13
eslint-config-taro: 2.0.0-beta.13 => 2.0.0-beta.13
eslint-plugin-taro: 2.0.0-beta.13 => 2.0.0-beta.13
nerv-devtools: ^1.5.5 => 1.5.6
nervjs: ^1.5.5 => 1.5.6
stylelint-config-taro-rn: 2.0.0-beta.13 => 2.0.0-beta.13
stylelint-taro-rn: 2.0.0-beta.13 => 2.0.0-beta.13

@taro-bot
Copy link

taro-bot bot commented Jan 5, 2020

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented Jan 5, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam
Copy link
Member

不能直接开启,有些 polyfill 方式在小程序中无法使用,请按照自己的需求按需引入 polyfill

@luckyadam luckyadam added answered question Further information is requested labels Jan 5, 2020
@spencer17x
Copy link
Contributor Author

如果只要引一次polyfill,在app.tsx中import一次就可以了吗?

@taro-bot taro-bot bot added the to be closed label Jan 5, 2020
@taro-bot
Copy link

taro-bot bot commented Jan 5, 2020

Hello~

您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants