New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v-form error: Cannot read properties of undefined (reading 'meta') #15157
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
9 tasks
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Hey guys, the devs are well aware of this issue and a fix is already in the pipeline! It doesn't help to spam this thread... |
A fix has been opened in #15160 and we're actively looking into it and verifying it. Thanks for the confirmations. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This was referenced Aug 19, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the Bug
When navigating to a page with
<v-form>
(content item, any collection's data model page), we will get an error:chrome_TItDX9GdNp.mp4
Seems like this is related to #15144, where now
fieldMaps
can be an empty object at start whenvalues.value
has no keys:directus/app/src/components/v-form/v-form.vue
Line 285 in a4f6529
However since
fieldNames
still is an array of field names, accessingfieldMaps[fieldName].meta
will trigger this error asfieldmaps[fieldName]
does not exist yet.A quick fix I tried was to ensurefieldNames
use a similar logic and return an empty array whenvalues.value
has no keys, as such:const fieldNames = computed(() => { + if (Object.keys(values.value).length === 0) return []; return fieldsInGroup.value.map((f) => f.field); });
but I'm not sure could there be a better fix at the moment.cc @br41nslugSeems like this is causing the options in field creation panel to not appear at all, so likely not a feasible solution.
To Reproduce
<v-form>
showing the fields.Alternatively, create a new collection so that the same error will happen when we are redirected to the new collection's data model page with
<v-form>
.Errors Shown
(This error was taken in dev build. Production builds should have minified variation of this error log)
Screenshot:
Text:
What version of Directus are you using?
9.16.0 (main branch a4f6529)
What version of Node.js are you using?
16.16.0
What database are you using?
SQLite
What browser are you using?
Chrome
How are you deploying Directus?
running locally in dev
The text was updated successfully, but these errors were encountered: