-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[non-writable] modification of global variable "Promise.prototype.finally" is not allowed when using plugins at app.json #380
Comments
在开发工具中提示的吗?你用的插件是什么? |
我用的是第三方插件,插件需要在 app.json 中注册哦。工具是微信调试工具,最新的版本。 @fxy060608 "usingComponents": true, 源码报错地址是下面的代码: Promise.prototype.finally function promisify (name, api) { |
@fxy060608 如上。 |
我也是用的三方插件做测试,没有提示报错,微信开发者工具是哪个版本,版本号贴出来 |
版本号:1.02.1905081 @fxy060608 |
已确认,你使用的微信开发者工具是预发布版本,可以先使用稳定版,稍后修复此问题 |
好,很给力! @fxy060608 |
问题描述
在使用插件的情况下,使用Promise ,封装的 uni.request, 提示如下错误:
[non-writable] modification of global variable "Promise.prototype.finally" is not allowed when using plugins at app.json
注意:微信限制在使用插件的时候修改原生属性,Promise.prototype.finally,不可以重写。
复现步骤
参考:
[或者可以直接贴源代码]
/**
*/
async function getSongById(id) {
uni.showLoading({
title: "加载中..."
});
let [error, res] = await uni.request({
url: URL_SONG,
header: util.getHttpHeader(),
data: {
resourceType: 2,
resourceId: id
}
});
uni.hideLoading();
return formatSong(id, res.data);
}
预期结果
无报错
实际结果
报错:[non-writable] modification of global variable "Promise.prototype.finally" is not allowed when using plugins at app.json
系统信息:
npm run info
的运行结果]补充信息
底层对 Promise.prototype.finally,进行了 复写!
The text was updated successfully, but these errors were encountered: