Skip to content
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

Offer UI feedback when config.yml incorrect, and other issue...? #17

Open
privatemaker opened this issue May 21, 2023 · 4 comments
Open
Labels
bug Something isn't working enhancement New feature or request

Comments

@privatemaker
Copy link

privatemaker commented May 21, 2023

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.

@privatemaker privatemaker changed the title Error after authentication successful with Github Offer UI feedback when config.yml incorrect, and other issue...? May 21, 2023
@kyoshino
Copy link
Member

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 🤣

@kyoshino kyoshino added the enhancement New feature or request label May 21, 2023
@kyoshino
Copy link
Member

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.

@kyoshino kyoshino added the bug Something isn't working label May 21, 2023
@kyoshino kyoshino self-assigned this May 21, 2023
@kyoshino
Copy link
Member

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. 🤔

@privatemaker
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants