sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
863 stars 43 forks source link

Files config results in an error #49

Closed ghostdevv closed 1 year ago

ghostdevv commented 1 year ago

Here is the config:

media_folder: "static/uploads/images"
public_folder: "/uploads"
publish_mode: editorial_workflow

collections:
  - label: "Pages"
    name: "pages"
    files:
      - label: "Requests"
        name: "requests"
        file: "src/content/requests.json"
        fields:
          - { label: "Title", name: "title", widget: "string" }

Seems like the error is coming from here with otherNames receiving [undefined].

https://github.com/sveltia/sveltia-cms/blob/b0285df84b18304014202d1ed2016ca4df809685/src/lib/services/utils/files.js#L191

The exact error message is: image

kyoshino commented 1 year ago

Thanks for the report! I’m able to replicate the issue and now trying to solve it. The fix should be coming shortly.

kyoshino commented 1 year ago

The fix is in! I couldn’t catch it earlier because it only happened when the i18n support wasn’t used, while all my clients use i18n. I’ll be adding automated tests to avoid this kind of problem later this year.

ghostdevv commented 1 year ago

Thank you!