Sylleth
Sylleth

Reputation: 25

VueSax: Cannot read properties of undefined (reading 'install') when using Individual Components

I have the exactly code below, it's like equal to the documentation that it's presented in vueSax when importing individual components, but it does not seems to work. In my console it's printed this error: TypeError: Cannot read properties of undefined (reading 'install')

I'm currently using Vue 2 and vuesax 4.0.1-alpha.25


<template>
  <div class="playgrond2">
    <vs-button>test</vs-button>
  </div>
</template>

<script>
import Vue from "vue";
import { vsButton } from "vuesax";
import "vuesax/dist/vuesax.css";
Vue.use(vsButton);
export default {
  name: "Playground2",
};
</script>

Upvotes: 0

Views: 7961

Answers (2)

Lk77
Lk77

Reputation: 2462

For anybody finding this :

Please note that vuesax (v3) and vuesax-next (v4) are not maintained, and that vuesax-next (v4) will likely be stuck in alpha forever.

vuesax-next (v4) was meant to work with Vue 3, however it's likely not working with newer Vue 3 versions like 3.2, it's likely only compatible with early Vue 3.0 alpha versions.

For Vue 2, vuesax (v3) is still compatible, however it's not maintained and will likely never be.

There is community forks of Vuesax however, I made one for Vue 3 :

https://www.npmjs.com/package/vuesax3

All components and functions do works in vue 3, both with Options API and Composition API.

And there is also forks for Vue 2, i've not tested them so i cant tell, but you can try them out if you want.

Upvotes: 0

low
low

Reputation: 21

I had the same issue with my nuxtjs app and fixed it by removing brackets from component import.

import vsButton from "vuesax";

Upvotes: 2

Related Questions