f / vue-wait

Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
MIT License
2k stars 101 forks source link

Vue 3 Complaining createVueWait() is not a function #107

Closed Mohanrau closed 3 years ago

Mohanrau commented 3 years ago

@vue/cli 4.5.13

error error-1

VadymGidulian commented 3 years ago

This helped me to get around the issue:

// webpack.config.js
resolve: {
    alias: {
        'vue-wait$': 'vue-wait/src/vue-wait.js'
    }
}
f commented 3 years ago

This should be fixed with the version v1.5.1

VadymGidulian commented 3 years ago

@f Thanks! But I got this error on 1.5.1:

TS2345: Argument of type 'Object' is not assignable to parameter of type 'Plugin_2'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
    The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
      Property 'install' is missing in type 'Object' but required in type '{ install: PluginInstallFunction; }'.

Workaround:

import {Plugin, createApp} from 'vue';
import {createVueWait}     from 'vue-wait'

const app = createApp(Index)
    .use(createVueWait({...}) as Plugin)
    .mount('#app');