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

Console warning: Failed prop type when clicking on Add to collection on latest develop #2715

Closed
PiyushChandra17 opened this issue Dec 13, 2023 · 5 comments

Comments

@PiyushChandra17
Copy link
Contributor

p5.js version

2.10.0

What is your operating system?

Mac OS

Web browser and version

Chrome and 117.0.5938.132

Actual Behavior

Console warning: Failed prop type when clicking on Add to collection on latest develop

Expected Behavior

There should be no console warning

Steps to reproduce

Steps:

  1. Open the editor web app
  2. Click on my sketches
  3. Click on add to collection from the dropdown menu
  4. Notice the console warning
@aryanas159
Copy link
Contributor

This error occurs when there are no collections, one potential solution could be to send an alert message "Please create a collection first". Can I work on this?

@lindapaiste
Copy link
Collaborator

Can you please paste the exact text of the error? I have seen prop-types errors when I have a collection which contains deleted items.

@aryanas159
Copy link
Contributor

@lindapaiste
image
The error isn't visible in the production environment.

@lindapaiste
Copy link
Collaborator

lindapaiste commented Dec 13, 2023

The error isn't visible in the production environment.

Prop-types errors are always shown in development only.

That warning doesn't seem like it's due to having no collections. An empty array would still meet all of the conditions enforced by the prop types.

It's due to one or more collections containing one or more items which don't match the required ItemsShape. Specifically, the bad item(s) don't have a .project.createdAt property. We don't ever examine that property so it should be removed from the prop types. In general, we should only specify the properties which are actually needed.

But I don't know if we need a new PR because it will be fixed by #2353 which removes all of the props.

@lindapaiste
Copy link
Collaborator

Closing as a duplicate of #2351

@lindapaiste lindapaiste closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants