sveltia-cms
sveltia-cms copied to clipboard
Offer UI feedback when config.yml incorrect, and other issue...?
I ran into another bug. After successfully doing the oauth dance, logging in, seeing request return 200
https://api.github.com/repos/user/my-repo/git/trees/a92c534exxx.......
Sveltia UI updates and says Loading Site Data...
but errors with following:
Uncaught (in promise) TypeError: re(...).findLast is not a function
ry https://example.org/admin/sveltia-cms.js:387
ry https://example.org/admin/sveltia-cms.js:387
xO https://example.org/admin/sveltia-cms.js:401
update https://example.org/admin/sveltia-cms.js:439
update https://example.org/admin/sveltia-cms.js:439
hv https://example.org/admin/sveltia-cms.js:1
He https://example.org/admin/sveltia-cms.js:1
promise callback*db https://example.org/admin/sveltia-cms.js:1
pv https://example.org/admin/sveltia-cms.js:1
ctx https://example.org/admin/sveltia-cms.js:1
fU https://example.org/admin/sveltia-cms.js:452
s https://example.org/admin/sveltia-cms.js:1
De https://example.org/admin/sveltia-cms.js:1
h https://example.org/admin/sveltia-cms.js:439
EA https://example.org/admin/sveltia-cms.js:439
EA https://example.org/admin/sveltia-cms.js:439
ab https://example.org/admin/sveltia-cms.js:1
$/< https://example.org/admin/sveltia-cms.js:1
He https://example.org/admin/sveltia-cms.js:1
promise callback*db https://example.org/admin/sveltia-cms.js:1
pv https://example.org/admin/sveltia-cms.js:1
ctx https://example.org/admin/sveltia-cms.js:1
jA https://example.org/admin/sveltia-cms.js:439
s https://example.org/admin/sveltia-cms.js:1
f4 https://example.org/admin/sveltia-cms.js:217
jA https://example.org/admin/sveltia-cms.js:439
ab https://example.org/admin/sveltia-cms.js:1
$/< https://example.org/admin/sveltia-cms.js:1
He https://example.org/admin/sveltia-cms.js:1
W https://example.org/admin/sveltia-cms.js:1
dU https://example.org/admin/sveltia-cms.js:452
kU https://example.org/admin/sveltia-cms.js:452
ev https://example.org/admin/sveltia-cms.js:1
<anonymous> https://example.org/admin/sveltia-cms.js:452
When switching to decap-cms / netlify-cms.js
I see the following error:
Error loading the CMS configuration
Config Errors:
'collections[1].fields[2].fields[0]' must have required property 'search_fields'
...
Check your config.yml file.
After fixing a few bugs in my config and properly loading the content in Decap, I still see above error in Sveltia.
What is also interesting is the config works fine when using localhost version.
Youβre right, I havenβt implemented comprehensive validation in Sveltia CMS. I think having a config editor is rather a must because hand-written config files are very problematic, but the CMS still needs a validator to catch any issue. In the meantime, please use Decap as a validator π€£
And yeah, I think your error is unrelated to search_fields
because the property is unused (not yet supported) in Sveltia CMS. Iβll figure out how it could happen.
Itβs a mystery at a glance. I thought it might be a browser compatibility issue because findLast
is relatively new, but it doesnβt make sense if it works with the local environment. π€
I think having a config editor is rather a must because hand-written config files are very problematic
Agreed ππ» that's the dream. One things i've wished for with Netlify/Decap (which diverges from a validation + editor) is that configs could be split into multiple files:
admin/
βββ index.html
βββ sveltia-cms.js
βββ config.yml
βββ collections/
βββ posts.yml
βββ pages.yml
βββ widgets.yml
This increases number of requests on load, but the collections could be lazy loaded so it's not too bad. This would progressively enhance, while being backwards compatible, yet allow a dev to wrangle the hundreds of lines of YAML a bit better.