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

Occasional "error.originalError.errors.map is not a function" errors #1024

Closed
ashley-conpago opened this issue Sep 26, 2023 · 2 comments · Fixed by #1095 · May be fixed by #1025
Closed

Occasional "error.originalError.errors.map is not a function" errors #1024

ashley-conpago opened this issue Sep 26, 2023 · 2 comments · Fixed by #1095 · May be fixed by #1025
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ashley-conpago
Copy link

ashley-conpago commented Sep 26, 2023

I very sporadically get errors in my project's tests "error.originalError.errors.map is not a function" which I've traced back to here in mercurius. could easily do a PR do add Array.isArray() there but this might hint at something else (me?) passing the wrong args to defaultErrorFormatter

@mcollina
Copy link
Collaborator

I think this is a bug here, would you like to send a PR?

@mcollina mcollina added bug Something isn't working good first issue Good for newcomers labels Sep 26, 2023
faizplus added a commit to faizplus/mercurius that referenced this issue Feb 13, 2024
closes mercurius-js#1024

check that error.originalError.errors is an array before mapping it.

if not an array, but is defined, try to handle it anyway.
@faizplus
Copy link

Hey @ashley-conpago, can you please add steps to reproduce this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
3 participants