NuxtN
Nuxt2y ago
Wazbat

null values in nuxt ui input

Hi there!
It looks like after a recent change of something, nuxt ui no longer allows certain values in a UInput's v-model? I get the following error when trying to display a possible null value in an input
Type 'string | null | undefined' is not assignable to type 'string | number | undefined'

It also appears that boolean options are no longer allowed in select menus either... Or an array of strings? Though that might be due to the null value
Type 'string[] | null | undefined' is not assignable to type 'string | 
number | Record<string, any> | unknown[] | undefined'.


If this change was intentional there a correct way to handle these kinds of data errors? It might just be a bad implementation my end if I'm using boolean values in select's for example

I am using @nuxt/ui: ^2.14.2. The error is also present on ^2.15.2 which is the latest version

The code used to build fine so I'm not sure what changed

I'm also really confused as I only get the errors when running nuxi typecheck, but not in my local vscode

Maybe it was an update to vue-tsc?
Was this page helpful?