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

Object doesn't support property or method 'finally' #6656

Open
LonHon opened this issue Aug 25, 2021 · 1 comment
Open

Object doesn't support property or method 'finally' #6656

LonHon opened this issue Aug 25, 2021 · 1 comment

Comments

@LonHon
Copy link

LonHon commented Aug 25, 2021

背景

构建之后有用户反应在Edge浏览器中报错,导致程序不能使用。

经过排查后发现确实报错代码处有使用promise.finally(),在本仓库Issues有搜到相关问题讨论,定位到 @vue/babel-preset-app/index.js 文件后发现如 @sodatea 所言,默认已声明finally

想确认下这个问题是我的配置上的原因吗?以及我应该如何处理这个问题?

此前相关讨论 #5348

我的项目配置及版本

vue-cli版本为4.5.13

package.json
image

babel.config.js
image


报错如图(建议右键新窗口打开查看原图):

image

Edge版本信息:

image

Version

4.5.13

Environment info

vue@3.1.2

Steps to reproduce

1

What is expected?

1

What is actually happening?

2

@fangbinwei
Copy link
Collaborator

fangbinwei commented Aug 25, 2021

我之前在一个很特殊的场景中遇到过这个问题, 我的应用里使用了'es7.promise.finally', 我的应用还引用了一个ui库, ui库也是用CLI打包的(包含polyfills), 重点是ui库只使用了Promise, 并没有使用finally方法, 从而导致ui库的promise polyfill “覆盖”了应用的promise polyfill, 导致finally 丢失了

不知道你的场景是不是也类似, 你可以尝试注释掉引入ui库的代码, 然后测试下finally方法是不是回来了, 来判断是不是和我类似

#6194

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

2 participants