nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
3.83k stars 470 forks source link

useFormGroup Cannot read properties of undefined (reading 'legend') #2223

Closed aligzl closed 1 day ago

aligzl commented 1 day ago

Environment

Version

v2.8.0

Reproduction

https://stackblitz.com/edit/nuxt-ui

Description

Hi, i am getting error while using useFormGroup as const { emitFormChange } = useFormGroup();

error-handler.ts:4 Global error handler TypeError: Cannot read properties of undefined (reading 'legend')
    at useFormGroup (useFormGroup.js?v=6ba076a3:8:29)
    at Object.setup (DatePicker.client.vue:20:28)
    at clone.setup (client-only.js?v=6ba076a3:80:41)
    at callWithErrorHandling (runtime-core.esm-bun…s?v=6ba076a3:197:19)
    at setupStatefulComponent (runtime-core.esm-bun…?v=6ba076a3:7843:25)
    at setupComponent (runtime-core.esm-bun…?v=6ba076a3:7804:36)
    at mountComponent (runtime-core.esm-bun…s?v=6ba076a3:5165:7)
    at processComponent (runtime-core.esm-bun…s?v=6ba076a3:5131:9)
    at patch (runtime-core.esm-bun…?v=6ba076a3:4647:11)
    at mountChildren (runtime-core.esm-bun…s?v=6ba076a3:4879:7) 
Proxy(Object) {…}
 setup function

Additional context

No response

Logs

No response

romhml commented 1 day ago

Sorry for that! I submitted a fix. In the meantime, you can use const { emitFormChange } = useFormGroup({}); to fix the issue.