Netlify CMS relation widget: "Details TypeError: Cannot read property ‘split’ of undefined"

Hello,

I am setting up netlify cms to work with eleventy. I am working on the config and I can’t make the relation widget work. Here is my config.yml:
config.yml on github
the entire github repository

When I get to the page to add a new “contenuGaleries” item the page throws me the following error:

Details TypeError: Cannot read property ‘split’ of undefined

If I remove the entire relation field everything works as expected.

What is wrong with my config.yml?

Thanks

There doesn’t seem to be anything wrong with your config, I think this is related to the issues with Git Gateway: https://www.netlifystatus.com/. Which is weird since you’re not using GitLab…

Thanks for your answer @tomrutgers,

Looking to the chrome console, the error seems a bit different (undefined here vs null for the other issue). The error seams to come from the fact that the script looks for nested fields, but the collection used in the relation widget has no subfield. Could it be the problem?

Regards

Also the outage affects only GitLab repos, so I think you may be on the right track around debugging CMS config. Sorry I don’t have more clues…

Hello,

I found the problem: the collection related to must be declared AFTER the “main” collection.

Thanks

1 Like

Oh wow, never came across that issue before, thanks for reporting back!

I hardly believe that I am the first one to come accross this issue :thinking:

It could be interesting to confirm this point by other users? And reflect it in the docs once confirmed?

thanks

Well I hardly think you’re the first either, but in a year of providing community support on almost a daily basis I can’t recall anyone raising this issue. Glad you found a solution, it should definitely be mentioned in the docs. Would you mind opening an issue (or PR) on Github?

I was about to open an issue but wanted to reproduce the issue first and I couldn’t! This time, whatever the collection order is, I don’t have any error.

So I don’t get what was wrong at first, but it seems fixed anyway!