KABBOUCHI / vue-tippy

VueJS Tooltip powered by Tippy.js
https://vue-tippy.netlify.app
MIT License
726 stars 87 forks source link

Component not working if use vue-tippy in other vue-plugin and use he in Nuxt 3 #238

Closed 4KDA closed 2 years ago

4KDA commented 2 years ago

When connecting the library (v.6.0.0-alpha.48) in Nuxt 3, the component does not work. The following warnings are in the console: image

However, the directive works.

Help, please.

KABBOUCHI commented 2 years ago

@4KDA plz can u share ur code? https://vite.new/vue

4KDA commented 2 years ago

I'm sorry, I was wrong. Now I tried different options and realized that with a clean install in nuxt3 everything works well. But, if I make my component library (vue-plugin), where I use vue-tippy, then this error really appears.

4KDA commented 2 years ago

this is my library index file

import * as components from "./components";

import VueTippy from "vue-tippy";

export default {
  install: (app, options) => {
    for (const key in components) {
      const component = components[key];
      app.component(key, component);
    }

    app.use(VueTippy);
  },
};

and this is the use plugin in nuxt3

import VueWind from '@kda/vuewind';

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(VueWind)
})

in this case an error occurs. I don't know, maybe it's a bug in nuxt3 and not in vue-tippy, but I'll be glad if you have any idea how to fix it

Thanks!

4KDA commented 2 years ago

I checked exactly the same case, but not in nuxt3, but in a clear vue3 + vite project, everything works there. Apparently, the problem is really in Nuxt, and not in vue-tippy. The issue should probably be closed.

Thanks for developing vue-tippy

KABBOUCHI commented 2 years ago

I published a version to fix the arrow warning

this what I'm using in my own nuxt 3 project, client only:

image
4KDA commented 2 years ago

I published a version to fix the arrow warning

this what I'm using in my own nuxt 3 project, client only:

image

When used this way, everything works. Error only if using vue-tippy in an intermediate plugin. Now only these errors remain image

But, as I wrote above, I think these errors are related to Nuxt. I will study this problem.

Thank you again

4KDA commented 2 years ago

After today's study, I realized that there is no problem if I download the source and build it. This is strange. Perhaps it would be nice if you added the "src" folder to the package, so that when using your library in our component libraries, we could include not the compiled file, but /src/plugin, I'm sure it would help.

Thanks again!

KABBOUCHI commented 2 years ago

sure, src included in v6.0.0-alpha.51

u can also try to import the plugin like this:

import { plugin } from `vue-tippy`
4KDA commented 2 years ago

Thanks! Now it works for me!