Why is promise.finally in my Vue project not working in Edge? Why is promise.finally in my Vue project not working in Edge? vue.js vue.js

Why is promise.finally in my Vue project not working in Edge?


I have ever faced that issue before.Only finally didn't work on Edge.I updated finally like below VVV and it worked.

This should handle the propagation of the thenable's species in addition to the behaviors detailed below:

Promise.prototype.finally = Promise.prototype.finally || {  finally (fn) {    const onFinally = value => Promise.resolve(fn()).then(() => value);    return this.then(      result => onFinally(result),      reason => onFinally(Promise.reject(reason))    );  }}.finally;

This implementation is based on the documented behavior of finally() and depends on then() being compliant to the specification:

A finally callback will not receive any argument, since there's no reliable means of determining if the promise was fulfilled or rejected. This use case is for precisely when you do not care about the rejection reason, or the fulfillment value, and so there's no need to provide it.

Unlike Promise.resolve(2).then(() => {}, () => {}) (which will be resolved with undefined), Promise.resolve(2).finally(() => {}) will be resolved with 2.

Similarly, unlike Promise.reject(3).then(() => {}, () => {}) (which will be fulfilled with undefined), Promise.reject(3).finally(() => {}) will be rejected with 3.

Note: A throw (or returning a rejected promise) in the finally callback will reject the new promise with the rejection reason specified when calling throw().


This is a known issue in core-js.

In theory, Edge provides a Promise polyfill for finally, but perhaps something is going on with the feature detection or your browserlist and you need to provide a polyfill :shrug:

I would delete both the Vue babel plugin and core-js from your project and then npm install them fresh.

  • npm install @vue/cli-plugin-babel --save-dev

  • npm install core-js --save

Also, make sure you're using core-js@3 via your config (babel.config.js) here

Lastly, there's a few Github issues talking about polyfills + Promises with regards to the other 3rd party libraries executed in your vuex store. Add all three of those libraries (axios, vue-axios, vuex) to your transpileDependencies section. If that fixes it, start removing the dependencies to see if they're needed.


Try adding a .browserslistrc file to your projects root with the following content:

> 1%last 2 versions

See https://github.com/browserslist/browserslist#best-practices information on last versions configuration.


If this does not resolve missing poly-fill, try disabling the plugin you are using that limits the number of chunks in order to ensure that this is not causing any poly-fills to be omitted.

plugins: [  new webpack.optimize.LimitChunkCountPlugin({    maxChunks: 6,  }),],