Akryum / floating-vue

💬 Easy tooltips, popovers, dropdown, menus... for Vue
https://floating-vue.starpad.dev/
MIT License
3.3k stars 337 forks source link

Nuxt stable v3.0.0 broken build using beta.20 #912

Closed samydoesit closed 1 year ago

samydoesit commented 1 year ago

Hello Nuxt v3.0.0 hast just released and i have found out that the build is crashing using "floating-vue": "2.0.0-beta.20",.

Stackblitz Repro

What is happening?

If i try to start the server dev or build it crashes immediately.

Nuxi 3.0.0                                                                                                18:16:18
Nuxt 3.0.0 with Nitro 1.0.0                                                                               18:16:19
                                                                                                          18:16:19
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.1.104:3000/

 ERROR  Cannot start nuxt:  Cannot read properties of undefined (reading 'nuxt')                          18:16:19

  at 𝐝𝐞𝐟𝐚𝐮𝐥𝐭 (node_modules/floating-vue/nuxt.mjs:15:21)
  at Module.installModule (node_modules/@nuxt/kit/dist/index.mjs:487:9)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1842:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6794:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6855:5)   

Expected behavior:

No crash on startup.

DamianGlowala commented 1 year ago

Fails right there in my case (nuxt.mjs): image

samydoesit commented 1 year ago

Simple workaround for now:

// plugins/floating-vue.ts
import { defineNuxtPlugin } from '#app'
import FloatingVue from 'floating-vue'
import 'floating-vue/dist/style.css'

export default defineNuxtPlugin(({ vueApp }) => {
  vueApp.use(FloatingVue)
})
dpmango commented 1 year ago

@samydoesit It works, thanks

Also need to remove modules: ['floating-vue/nuxt'] from nuxt.config.js

BlackSkyJY commented 1 year ago

It works, but when i execute the command node .output/server/index.mjs ,Fails right there image

samydoesit commented 1 year ago

@BlackSkyJY In our Nuxt 3 Project node .output/server/index.mjs works without problems using the suggested workaround.

Looks like a Problem on your side. Provide a reproduction for further investigation.

zc1342303 commented 1 year ago

It works, but when i execute the command node .output/server/index.mjs ,Fails right there image

Same as me.

samydoesit commented 1 year ago

I can only guess maybe a Windows Problem. 🤷‍♂️

Could @zc1342303 and/or @BlackSkyJY open a new Issue because on Unix/Mac platform node .output/server/index.mjs is working.

cryptopay-pavel commented 1 year ago

I have same issue on my intel macbook. Nuxt 3.0.0-rc.14 with Nitro 1.0.0 using beta.20

abdonrd commented 1 year ago

I also have this error:

ERROR Cannot start nuxt: Cannot read properties of undefined (reading 'nuxt')

Using macOS and Nuxt v3.2.

TheSupremeBeard commented 1 year ago

Any none workaround janky fix for this yet?

juliesaia commented 1 year ago

It works, but when i execute the command node .output/server/index.mjs ,Fails right there image

Same as me.

Fixed for me after updating Nuxt to 3.2.3!

katerlouis commented 1 year ago

Even with Nuxt 3.2.3, I still get Cannot read properties of undefined (reading 'nuxt')

image

Maybe @danielroe can help here?

urbgimtam commented 1 year ago

I've successfully installed it in Nuxt 3.4.1 by creating a plugin.

// plugins/floating-vue.ts

import FloatingVue from "floating-vue"

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(FloatingVue)
})
samydoesit commented 1 year ago

Closing, fixed since v2.0.0-beta.23