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

[v5] "Configure the view" not possible after updating nested, related components in a dynamic zone #22500

Open
pfasse-salt opened this issue Dec 23, 2024 · 0 comments

Comments

@pfasse-salt
Copy link

pfasse-salt commented Dec 23, 2024

Bug report

Required System information

  • Node.js version: 20.5.1
  • NPM version: 9.8.0
  • Strapi version: 5.6.0
  • Database: PostgreSQL 15.10
  • Operating system: Debian 12 (bookworm)
  • Is your project Javascript or Typescript: JS

Also tested with npm/10.8.2 node/v20.17.0 darwin arm64 - seems unrelated.

Describe the bug

Maybe related to #20978 and #21059. But since those got closed as completed with a fix and im still running into that kind of issue there may be a new bug or some unnoticed edge cases.

When I try to configure the view of an element (/admin/content-manager/components/someelementname/configurations/edit) I get the following error with the "Something went wrong"-view:

Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')
    at oDe (strapi-Cnl_eieY.js:2686:25230)
    at strapi-Cnl_eieY.js:2686:27306
    at Array.map (<anonymous>)
    at strapi-Cnl_eieY.js:2686:27071
    at Array.map (<anonymous>)
    at Sme (strapi-Cnl_eieY.js:2686:27062)
    at ComponentConfigurationPage-DaPOlQaD-DZxDLssy.js:1:3014
    at Array.reduce (<anonymous>)
    at V (ComponentConfigurationPage-DaPOlQaD-DZxDLssy.js:1:2982)
    at ComponentConfigurationPage-DaPOlQaD-DZxDLssy.js:1:1777

Important to note: The error is gone after a restart of the strapi-service. But it may be interesting to find the cause of that problem since regular users are able to trigger that, unable to restart the service.

Steps to reproduce the behavior

  1. create a collection type (lets call it "pages" for references) with a dynamic zone ("blocks")
  2. create a component ("slider") which has some basic-fields (like "fluid") and a repeatable component "slides" which also has some fields (like "title")
  3. add that "slider"-component to our dynamic-zone "blocks" of the "pages"-collection
  4. create component ("content") that has a field referencing the previously created component (= a "content"-component may have a "slider")
  5. add that "content"-component to our dynamic-zone "blocks" of the "pages"-collection
  6. create some "pages" that use the previously created component
  7. open a created entry within the content manager and go to the "Configure the view"-page
  8. open the config of the "content"-component and go back (just to see that it works fine)
  9. open the config of the "slider"-component, edit a field, click "finish" in the dialog, save the view
  10. click "Set the component's layout" of our nested "slides"-component, edit a field and press "finish" in the dialog followed by a "save" in the upper right corner
  11. click "back" in the upper left corner -> many "An error occurred while trying to open the form."-popups get shown
  12. click "back" again so we're back at our page from step 7
  13. important: Reload the browser-tab
  14. try to do step 8 again and you'll the the "Something went wrong"-view with the shown "Cannot read properties of undefined (reading 'attributes')"-error
  15. that error is persistent until the next restart of the strapi-service (then everything is fine again)

Expected behavior

  1. no "An error occurred while trying to open the form"-errors shown in step 11
  2. no "Something went wrong"-view until a restart when you try to use the "Configure the view"-Tool

Screenshots

Structure of the "pages" collection
strapi_collection_pages_datastructure

Structure of the "content"-component (and the "slider"-component) used in the "pages" collection
strapi_component_content_datastructure

View after step 11:
strapi_erroroccuredview

View after step 14:
strapi_somethingwentwrongview

Code snippets

No code to provide since the error occurs while using the ui.

Additional context

As previously mentioned, the error may be related to #20978 and #21059.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant