vuejs/vue-cli

On Firefox, the finally method from Promise prototype don't work when a Vue project is included as a library

Open

#4,221 创建于 2019年7月2日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (29,754 star) (6,328 fork)batch import
bughelp wanted

描述

Version

3.8.4

Reproduction link

https://github.com/Gnuk/vue-cli-polyfill-finally-firefox-issue

Environment info

Environment Info:

  System:
    OS: Linux 5.1 Arch Linux undefined
    CPU: (8) x64 Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.16.0 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 67.0.4
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  3.8.0 
    @vue/babel-preset-jsx:  1.0.0 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.0.0 
    @vue/babel-sugar-v-on:  1.0.0 
    @vue/cli-overlay:  3.8.0 
    @vue/cli-plugin-babel: ^3.8.0 => 3.8.0 
    @vue/cli-plugin-typescript: ^3.8.0 => 3.8.1 
    @vue/cli-service: ^3.8.0 => 3.8.4 
    @vue/cli-shared-utils:  3.8.0 
    @vue/component-compiler-utils:  2.6.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    typescript: ^3.4.3 => 3.5.2 
    vue: ^2.6.10 => 2.6.10 
    vue-class-component: ^7.0.2 => 7.1.0 
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-property-decorator: ^8.1.0 => 8.2.1 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 3.8.4

Steps to reproduce

From finlib folder, launch npm i and then npm run build:lib to build the Vue project as a library.

Publish it in a npm registry (i used Verdaccio).

I don't test it using npm link.

From finhost folder, launch npm i (you propably should edit .npmrc to add your registry URL and remove package-lock.json before).

Launch the project using npm run serve and open the app on:

  • Firefox - You should see this message inside the terminal:
    [Vue warn]: Error in created hook: "TypeError: promise.finally is not a function"
    
    found in
    
    ---> <HelloWorld> at src/components/HelloWorld.vue
           <App> at src/App.vue
             <Root> vue.runtime.esm.js:619
    
  • Chrome - There is a native usage, you will see:
    Finally should work
    

What is expected?

The finally method from Promise should work without side effects from another Vue library.

What is actually happening?

The finally method from Promise don't work on Firefox.


Maybe Firefox is not the only browser with this issue.

贡献者指南

On Firefox, the finally method from Promise prototype don't work when a Vue project is included as a library · vuejs/vue-cli#4221 | Good First Issue