initbase / vue-modal-2

A simple and lightweight Vue (v2) modal component.
https://initbase.github.io/vue-modal-2/
MIT License
8 stars 4 forks source link

At the first start "btoa is not defined" #11

Closed reualex closed 3 years ago

reualex commented 3 years ago

When you running your nuxt application at the first time, get error: [Vue warn]: Error in beforeCreate hook: "ReferenceError: btoa is not defined" After save any component - the error disappears.

burhanahmeed commented 3 years ago

BTW, my package didn't use btoa. I am not sure about this warning

reualex commented 3 years ago

BTW, my package didn't use btoa. I am not sure about this warning

Yep, me too. But If I don't use plugin this error dissapear.

` [Vue warn]: Error in beforeCreate hook: "ReferenceError: btoa is not defined" 09:57:11

found in

   <VueModal2>
   <ModalsWindows> at components/Common/ModalsWindows/index.vue
     <DefaultLayout> at layouts/default.vue
       <Root>`

It is full error message

burhanahmeed commented 3 years ago

are you using Nuxt or just Vue? which version?

TuanHarry commented 3 years ago

I'm using nuxt version 2.15.3

TuanHarry commented 3 years ago

solution : wrapped with <client-only> </client-only> (previously` no-ssr)

burhanahmeed commented 3 years ago

yes for Nuxt you need to wrap it https://initbase.github.io/vue-modal-2/installation/vue-2x.html#nuxt