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

TypeError: Cannot read properties of undefined (reading 'length') after upgrade to 4.20.3 #19660

Closed
vsamofal opened this issue Mar 4, 2024 · 25 comments
Assignees
Labels
flag: EE Issues correlates to internal EE ticket issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:admin Source is core/admin package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 4 Issue related to v4

Comments

@vsamofal
Copy link

vsamofal commented Mar 4, 2024

Bug report

Required System information

STRAPI_ENFORCE_SOURCEMAPS=true in your .env --> (sorry I tried it, but it's not working)

  • Node.js version: v18.14.2
  • NPM version: 9.5.0
  • Strapi version: 4.20.3
  • Database: postgres
  • Operating system: darwin-arm64
  • Is your project Javascript or Typescript: js

Describe the bug

After to upgrade to latest version, frontend is failing with exception on reading a length property, on one particular collection, and lead to white screen in both dev and prod modes. Refreshing the page helps, and it loading entity and allows me to add/edit and do everything that I want. But once I go to another collection and moving back to this entity - white screen again. Refresh and it's working just fine.

If I'm switching menu and getting back to content manager, I can open this page fine, so the problem appears only when I'm switching between collections.

If I'm switching to single types, I can back to collection just fine as well. So again the problem appears only

Expected behavior

Switching between collections should work fine

Code snippets

Sorry for this... but I can't make source map works

main.0f63a8e2.js:805 TypeError: Cannot read properties of undefined (reading 'length')

Error happens here, f is undefined
image

field definition

  "faq": {
      "displayName": "faq",
      "type": "component",
      "repeatable": true,
      "component": "general.faq"
    }

but when I'm refreshing the page, this field is there, seems like some async processing happen:

image

hopefully it helpful and enough, if not let me know what else to share

@philipschikora
Copy link

I am experiencing the same issue

@brechtpallemans
Copy link

Same issue here, I'm on version 4.20.2

@philipschikora
Copy link

Affects version 4.20.1 also

@magikarp28
Copy link

Same issue here, on 4.20.5

@Eventyret Eventyret added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:admin Source is core/admin package status: pending reproduction Waiting for free time to reproduce the issue, or more information version: 4 Issue related to v4 labels Mar 14, 2024
@coderdix24
Copy link

same issue

@vsamofal
Copy link
Author

4.21.0 still here

@vsamofal
Copy link
Author

Found that it happen also with a backend error, where limit passed to the query is undefined
image

@ioanaasurdu

This comment has been minimized.

@anurodhsahu

This comment has been minimized.

@philipschikora

This comment has been minimized.

@anil1712

This comment has been minimized.

@topolar

This comment has been minimized.

@losetchi

This comment has been minimized.

@WDeenik

This comment has been minimized.

@anil1712

This comment has been minimized.

@magikarp28

This comment has been minimized.

@philipschikora
Copy link

That is no option for me

@dennism501
Copy link
Member

Internal TID: 6529

@dennism501 dennism501 added severity: high If it breaks the basic use of the product and removed severity: medium If it breaks the basic use of the product but can be worked around labels Apr 19, 2024
@derrickmehaffy derrickmehaffy added the flag: EE Issues correlates to internal EE ticket label Apr 19, 2024
@alexandrebodin
Copy link
Member

Hello,

@vsamofal can you share what version you were upgrading from so we can try to reproduce ? we can't reproduce by just using the v4.20.x version as of now.

Something you can test (locally at 1st and with non important data ⚠️) is to clear the plugin_content_manager_xxx keys in your strapi_core_store_settings table to see if it's a data inconsistency.

Also this might have been fixed in more recent version of Strapi, have you tried upgrading to latest since then ?

@derrickmehaffy derrickmehaffy added status: confirmed Confirmed by a Strapi Team member or multiple community members and removed status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Apr 22, 2024
@Bobivankenobi
Copy link

Bobivankenobi commented Apr 22, 2024

@alexandrebodin I'm facing this error with the latest version of Strapi, 4.23.1. I'm also happy to jump on a call with you to replicate the bug successfully. I think the issue is related to the use of a repeatable component in a certain context. The last version in which this bug does not occur is 4.16.2.

bug1.mp4

@Bobivankenobi
Copy link

@alexandrebodin Question collection type.

Screenshot 2024-04-22 at 21 06 40

@vsamofal
Copy link
Author

I was on 4.16.1, and quite a similar situation as @Bobivankenobi has, I do have a repeatable component in my collection type as well

image

@alexandrebodin
Copy link
Member

Thanks for the details 🙌 I'll dig into it later today

@alexandrebodin
Copy link
Member

ℹ️ The fix will be released tomorrow :)

@Bobivankenobi
Copy link

ℹ️ The fix will be released tomorrow :)

Awesome @alexandrebodin Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: EE Issues correlates to internal EE ticket issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: core:admin Source is core/admin package status: confirmed Confirmed by a Strapi Team member or multiple community members version: 4 Issue related to v4
Projects
Status: Fixed/Shipped
Status: Fixed/Shipped
Status: Done
Development

No branches or pull requests