You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to add a custom component to display a gallery of 6 images fetched from AWS S3 (which contains >= six images at root). For this, I copied the MediaGallerySection and created a file content/pages/backgrounds.md. I've then added mappings for it to src/components/components-registry.tsx, and src/types/generated.ts following the pattern I saw. However, I got an error. In an effort to solve that, I fix a simple mistake, but then got another error.
In the visual editor, it is being rendered as expected. However, I have two issues:-
When editing another section anywhere through the visual editor, the preview fails to load and I have to restart the editor
Also, i can't edit this element (section) through the visual editor. I have to go to code every time I want to make changes to it
Here's the error I got in the logs (the first one appeared as soon as I added the new component, and the latter after trying to do some workarounds):-
7:51:05 PM: [error] Error converting value in file 'content/pages/backgrounds.md' at field path 'sections.0' of declared type 'model'. No model found with name: WallpaperGallerySection.
7:51:05 PM: [error] Error converting value in file 'content/pages/backgrounds.md' at field path 'sections' of declared type 'list'. One of the list items could not be converted, ignoring the while list.
7:51:20 PM: [error] AnnotationError: Field path sections.0 not found or does not match content schema fieldPath:'sections.0', value:'{"oid":null,"fp":"sections.0","loc":"*[1]","hasOnlyTextNodes":false}', elementXPath:'/html/body[1]/div[1]/data[1]/data[1]/div[1]/div[2]/main[1]/div[1]/data[1]'
7:51:24 PM: [error] AnnotationError: Field path sections.0 not found or does not match content schema fieldPath:'sections.0', value:'{"oid":null,"fp":"sections.0","loc":"*[1]","hasOnlyTextNodes":false}', elementXPath:'/html/body[1]/div[1]/data[1]/data[1]/div[1]/div[2]/main[1]/div[1]/data[1]'
I was trying to add a custom component to display a gallery of 6 images fetched from AWS S3 (which contains >= six images at root). For this, I copied the MediaGallerySection and created a file
content/pages/backgrounds.md
. I've then added mappings for it tosrc/components/components-registry.tsx
, andsrc/types/generated.ts
following the pattern I saw. However, I got an error. In an effort to solve that, I fix a simple mistake, but then got another error.In the visual editor, it is being rendered as expected. However, I have two issues:-
Here's the error I got in the logs (the first one appeared as soon as I added the new component, and the latter after trying to do some workarounds):-
And here's the code for the component:-
The text was updated successfully, but these errors were encountered: