Closed joneath closed 1 year ago
Didn't go into the details but I had the same problem when adding the float-vue/nuxt
to modules
in nuxt.config.ts
.
I created my own plugin (a temp solution) :
/plugins/floating-vue.ts
contents:
import { defineNuxtPlugin } from "#app";
import FloatingVue from "floating-vue";
import "floating-vue/dist/style.css";
export default defineNuxtPlugin((nuxtApp) => {
// @TODO cutomization
nuxtApp.vueApp.use(FloatingVue);
});
and floating-vue works in nuxt 3.5.3.
Didn't go into the details but I had the same problem when adding the
float-vue/nuxt
tomodules
innuxt.config.ts
.I created my own plugin (a temp solution) :
/plugins/floating-vue.ts
contents:import { defineNuxtPlugin } from "#app"; import FloatingVue from "floating-vue"; import "floating-vue/dist/style.css"; export default defineNuxtPlugin((nuxtApp) => { // @TODO cutomization nuxtApp.vueApp.use(FloatingVue); });
and floating-vue works in nuxt 3.5.3.
This was the documented solution to using the package in Nuxt prior to beta 21 when supposedly a in package nuxt module was added. Beta 22 added the module but in a broken state 😔
The nuxt module blows up on nuxt boot. From the src it looks like
this
is undefined on line 2const nuxt = this.nuxt
. Any reason not to use eitherdefineNuxtModule
(probably don't want to add@nuxt/kit
as a dependency) or use the passednuxt
instance as described in the docs?Cannot read properties of undefined (reading 'nuxt')