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

isErrorFromPath seems to be inferring a never type #333

Closed
ronaldcurtis opened this issue Feb 13, 2023 · 2 comments
Closed

isErrorFromPath seems to be inferring a never type #333

ronaldcurtis opened this issue Feb 13, 2023 · 2 comments

Comments

@ronaldcurtis
Copy link

ronaldcurtis commented Feb 13, 2023

The Bug

Here is a reproduction CodeSandbox.

I am using openapi-zod-client to generate a zodios api, and am trying to use isErrorFromPath to narrow error types. However, I seem to get a never type when attempting to use it (see screenshot).

Screen Shot 2023-02-13 at 11 17 00 am

Workaround

You can work around this by adding an alias and using isErrorFromAlias instead. But this is quite a chore since we are generating the zodios api from an openapi yaml file. Regenerating the zodios api will also result in losing these alias fields.

@ecyrbe
Copy link
Owner

ecyrbe commented Feb 13, 2023

Thank you for the report and the reproductible exemple.

@ecyrbe
Copy link
Owner

ecyrbe commented Feb 13, 2023

This should be fixed in version v10.7.7 : https://codesandbox.io/s/magical-haze-d71zbj?file=/src/api.ts

@ecyrbe ecyrbe closed this as completed Feb 13, 2023
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

2 participants