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

Uncaught TypeError: Cannot read properties of undefined (reading 'push') #241

Closed
hiteshjoshi opened this issue Jan 5, 2024 · 4 comments
Closed

Comments

@hiteshjoshi
Copy link
Contributor

public createCollection(collection: any[], element: any) {

In chrome, $hsAccordionCollection or $hsDropdownCollection is undefined. Need a check for that here.
Screenshot 2024-01-06 at 5 17 50 AM

hiteshjoshi added a commit to hiteshjoshi/preline that referenced this issue Jan 5, 2024
@olegpix
Copy link
Collaborator

olegpix commented Jan 15, 2024

public createCollection(collection: any[], element: any) {

In chrome, $hsAccordionCollection or $hsDropdownCollection is undefined. Need a check for that here.
Screenshot 2024-01-06 at 5 17 50 AM

Hello,
Could you create an example on Stacklblitz and share it with us? I see that you are using Svelte and perhaps the problem depends on the framework and specific use case.

@hiteshjoshi
Copy link
Contributor Author

Too lazy. But even than, its a good idea to check for empty array, isn't?

@jahaganiev
Copy link
Member

Hey @hiteshjoshi - closing the issue for now. Unfortunately, it's hard to help if we don't have full picture - hope for your kind understanding.

@hiteshjoshi
Copy link
Contributor Author

hiteshjoshi commented Mar 5, 2024

I am just saying, you are not checking for an empty array and its throwing error. MY PR adds a check. thats all. Fail to understand, how to create "full picture" here.

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

3 participants