This field cannot have keys not specified in the object shape - FIXING STORY

Hi,

I had an issue when I try to create a collection or add/edit a field through the strapi admin which throws me this error “this field cannot have keys not specified in the object shape” which I had no idea why it was happening and initially I tried migrating to upper versions of strapi, Clearing out the database, Removing my graphql plugin, Checking model settings files, And even I debugged strapi content type builder plugin in my node_modules folder and I found out from where the error was generating from but I couldn’t find why. After that I copied all of my api folder to a new strapi project and then the issue was gone :smiley: . But there were lot of settings I have to migrate if I move on to a new project.

When I finally decided to move on to a new project I saw that I have a middlewares folder which I have created in my project a long time back watching this youtube video https://www.youtube.com/watch?v=AsEGCzFiWTM which is a great video.
Here’s the content of my middlewares/ctx/index.js file.

I commented that part and the content type builder started working perfectly after that :yum: .

I have shared this story if this helps anyone since I have spent days and gave up debugging this issue and I started creating collection types manually which was a pain. My issue might not be the case for everyone but if this helps incase it would save a whole lot of time.

Thank you :wink:

Hi @sanojsilva, thanks a lot for sharing this. I have been trying to debug the same issue for hours and then I found your post. I had also followed the same video and was getting the same error.

I wish I had found your post sooner.

Thanks again!

1 Like