Error when clicking on "Add a component" in Dynamic zone (TypeError: Cannot read properties of undefined (reading 'length'))

System Information
  • Strapi Version: v4.15.0
  • Operating System: windows
  • Database: SQLite
  • Node Version: v20.9.0
  • NPM Version:
  • Yarn Version: v1.22.10

A white screen appears, when I click “Add a component” in a Dynamic zone. It is a new strapi instance, created with yarn:

It shows the following error in the console:

Uncaught TypeError: Cannot read properties of undefined (reading ‘length’)
at Aa (content-type-builder.0bc97051.chunk.js:131:5319)
at Ss (main.f84563f1.js:736:20469)
at fh (main.f84563f1.js:738:45155)
at lh (main.f84563f1.js:738:40774)
at ip (main.f84563f1.js:738:40702)
at $f (main.f84563f1.js:738:40556)
at Gu (main.f84563f1.js:738:36811)
at xd (main.f84563f1.js:738:37616)
at za (main.f84563f1.js:736:3278)
at main.f84563f1.js:738:35128

1 Like

I did not have any issues. Able to add components. Which Strapi version are you on?
i see that you have added components previously. Can you provide me with steps to replicate. Maybe there is an issue with the particular component that you are adding.

Please run yarn build or npm run build if this does not fix your issue please open a issue on Issues · strapi/strapi · GitHub

Same issue npm run build does nothing

I’m using “@strapi/strapi”: “4.15.0”

downgrading to 4.13.0 worked for me

I did a downgrading to 4.14.0, now it works. Thanks for your help!

how did you downgrade it to 4.14? I am currently in 4.15

can you help me with downgrad !

You have to change the versions in the package.json file:

image

After that, you can run yarn install

i did it , still version 4.15.0 when run npm run develop

I recommend you, to switch from npm to yarn. Check this article:
https://medium.com/@bosti/npm-to-yarn-migration-guide-full-tutorial-step-by-step-how-to-migrate-40533da1bb0d

Thanks for your efforts !

Same error, Is there a better solution or I need to downgrade? (same error on stripe 15.0 and 15.2)

see github issue

I think Version4.15 came with trouble of plugins.

I remember that I downgrade for anohter problem to solve.

Edit:
But I upgraded to V4.16(.2) seems ok.
I think they fixed many troubles. Thanks.
seems that they did good job.