vue-select
vue-select copied to clipboard
Error in getter for watcher "filteredOptions": "TypeError: Cannot read properties of null (reading 'concat')"
I get error app.js:107129 [Vue warn]: Error in getter for watcher "filteredOptions": "TypeError: Cannot read properties of null (reading 'concat')"
whenever I navigate to page with v-select from another page. After that, I reload page (F5) and the error is gone and v-select works normally.
` "
<v-select
option:deselected="deselectedValue()"
:options="podaci"
label="name"
v-model="fields[number]"
:selectable="
option =>
!checkIfExist(
option.name
)
"
@input="
setSelectedValue(
$event,
number
)
"
>`
Variable podaci
is object.
I am using Opera on Windows 10.
The same for me
I know this is 7 months late, I've just been getting the same issue but I think I've found what was causing it.
Is there a point on first clean load where podaci
is null? I notice you dont have a v-if using podaci
so it will throw an error when it first loads the component.
I was setting the default value of my options as null
and after fetching data for vselect it would load correctly with those errors thrown in console. After setting the default value to []
it was no longer throwing that error.
So as a workaround in place of null value handling within the vselect
- either set default value of options variable as
[]
or - use v-if and check if options variable is not
null
before loading it
The same for me
The options
prop requires an array - supplying anything else will trigger that error.
Sometimes (while data is loading) for complex data structures it could be null or undefined. It would be nice if it will be considered as [] inside vue-select. @sagalbot