ajmas / vue-authenticate-2

Simple Vue.js authentication library
10 stars 4 forks source link

Import not working #25

Open DartVadius opened 4 months ago

DartVadius commented 4 months ago

I do as example says import VueAuthenticate from 'vue-authenticate-2' and recieve an error export 'default' (imported as 'VueAuthenticate') was not found in 'vue-authenticate-2' (module has no exports). What I am doing wrong? Same thing when i try to import VueAuthenticatePlugin

klues commented 2 months ago

I had the same issue and solved it by using

resolve: {
   alias: {
       "vue-authenticate-2": 'vue-authenticate-2/dist/vue-authenticate.es.js'
   }
},

In my webpack.config.js. However I don't know why it's needed. However I got to an exception complaining about a missing $http. I'm on Vue2, so maybe this Version of the library only works with Vue3?! I'm now trying the original version from https://github.com/dgrubelic/vue-authenticate and the "Usage" docs from there, which seem to work better for Vue2.