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

[Bug report]TypeError: Function(...) is not a function #479

Closed
HelloUndefined opened this issue Jun 10, 2020 · 4 comments
Closed

[Bug report]TypeError: Function(...) is not a function #479

HelloUndefined opened this issue Jun 10, 2020 · 4 comments

Comments

@HelloUndefined
Copy link

问题描述
跨平台构建小程序, 使用async/await, 微信编译功能正常, 支付宝报错
2. 期望的表现
支付宝正常使用async/await
3. 实际的表现
TypeError: Function(...) is not a function
QQ图片20200610202329
QQ图片20200610202339
微信图片_20200610201308
QQ图片20200610202347

Windows环境
"@mpxjs/api-proxy": "^2.5.10",
"@mpxjs/core": "^2.5.11",
"@mpxjs/fetch": "^2.3.9",
"@mpxjs/webpack-plugin": "^2.5.11",
支付宝开发者工具版本1.12.15
微信开发者工具版本1.03.2005140

最简复现demo
demo.zip

@sky-admin
Copy link
Collaborator

facebook/regenerator#381
应该是由于babel7的runtime依赖的regenerator-runtime导致的。
建议生产环境先使用Babel6。

@hiyuki
Copy link
Collaborator

hiyuki commented Jul 2, 2020

https://github.com/didi/mpx/releases/tag/v2.5.31
目前Mpx已经正式支持babel7,上面的问题已经修复,可以使用脚手架新创建项目使用

@zyaxuan
Copy link

zyaxuan commented Aug 1, 2022

更新到babel7, "@mpxjs/api-proxy": "^2.7.44", 也更新到 2.7.44 当前问题还是存在

{
    "@babel/core": "^7.10.4",
    "@babel/eslint-parser": "^7.16.0",
    "@babel/plugin-transform-runtime": "^7.10.4",
    "@babel/plugin-transform-typescript": "^7.16.1",
    "@babel/preset-env": "^7.10.4",
    "@babel/runtime-corejs3": "^7.10.4",
}

@Blackgan3
Copy link
Collaborator

Blackgan3 commented Aug 3, 2022

更新到babel7, "@mpxjs/api-proxy": "^2.7.44", 也更新到 2.7.44 当前问题还是存在

{
    "@babel/core": "^7.10.4",
    "@babel/eslint-parser": "^7.16.0",
    "@babel/plugin-transform-runtime": "^7.10.4",
    "@babel/plugin-transform-typescript": "^7.16.1",
    "@babel/preset-env": "^7.10.4",
    "@babel/runtime-corejs3": "^7.10.4",
}

需更新至 @mpxjs/[email protected] 版本

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

No branches or pull requests

5 participants