vue-tour icon indicating copy to clipboard operation
vue-tour copied to clipboard

Vue Tour 1.5.0 breaks promise polyfill

Open mamk95 opened this issue 5 years ago • 1 comments

Describe the bug When importing Vue Tour 1.5.0, the automatic Vue polyfill for Promise function "finally" stops working. This can be seen in browsers not natively supporting finally, such as IE11. This does not happen with Vue Tour 1.4.0.

Demo: https://github.com/mamk95/vue-tour-breaks-polyfill-js See comment in main.js for how to trigger bug: VueTourBreaksPolyfillCode

To Reproduce Steps to reproduce the behavior:

  1. Start with a normal Vue project ("vue create project-name"), make sure Babel is included.
  2. Add a promise with "finally" anywhere in the code. Run "npm run serve" and check that "finally" works.
  3. Add Vue Tour.
  4. Run "npm run serve" and observe that "finally" has stopped working.

Expected behavior Vue Tour should not remove the "finally" polyfill.

Screenshots Part of the error is in Norwegian. Translated to English: "TypeError: Object doesn't support property or method finally". VueTourBreaksPolyfill

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: IE 11
  • Version: Vue Tour 1.5.0

mamk95 avatar Sep 02 '20 09:09 mamk95

Hi there! I've got same problem, my project has same babel config preset as this plugin. To use .finally() promise method (that is ES7 feature) i use polyfills 'babel-polyfill' and 'es6-promise/auto' imported in my entry app file. Vue-tour bundled as module and includes babel-preset code with polyfills (core-js). This code sets Promise.prototype with no .finally method. So, to solve this problem you should import your promise polyfills after installing vue-tour plugin for keeping desired Promise.prototype unchanged by vue-tour. Also you can try to include promise polyfills into your babel.config preset and add vue-tour dist (node_modules) to transpileDependencies.

Laexssi avatar Oct 05 '21 14:10 Laexssi