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

[BUG] useMany throws an error if ids or resource is undefined/not passed #6617

Open
aliemir opened this issue Dec 30, 2024 · 0 comments · Fixed by #6618
Open

[BUG] useMany throws an error if ids or resource is undefined/not passed #6617

aliemir opened this issue Dec 30, 2024 · 0 comments · Fixed by #6618
Assignees
Labels
bug Something isn't working

Comments

@aliemir
Copy link
Member

aliemir commented Dec 30, 2024

Describe the bug

@refinedev/core's useMany hook throws unhandled errors if ids is not a valid array or resource prop is missing. Currently only check for these values are done by types but not in runtime.

Steps To Reproduce

  • Import useMany from @refinedev/core
  • Ignore type error and pass ids as undefined
  • See the errors thrown without any chance of handling them except error boundaries

Expected behavior

This needs to be handled in the implementation and instead of throwing unexpected errors, query must be disabled and should warn about missing props.

Packages

  • @refinedev/core

Additional Context

No response

@aliemir aliemir added the bug Something isn't working label Dec 30, 2024
@aliemir aliemir added this to the January 2025 🎄 milestone Dec 30, 2024
@aliemir aliemir self-assigned this Dec 30, 2024
@aliemir aliemir linked a pull request Dec 30, 2024 that will close this issue
5 tasks
BatuhanW pushed a commit that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant