-
Notifications
You must be signed in to change notification settings - Fork 127
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
Property 'statusCode' does not exist on type 'FetchError<any>' #278
Comments
Thanks for making issue. You can use new |
It was actually working before. |
@misbahansori @sharifzadesina I had the same problem and provided a PR to ensure TypeScript understands and provides properties like For my own purposes before the PR gets merged (or a better solution found 😉), you can re-export the type: export type { IFetchError as FetchError } from 'ofetch' Which I did in my Nuxt API Party plugin: johannschopplich/nuxt-api-party@181a5a0 |
In the meantime, does anyone have a good approach to narrow the types within the catch block? Since the error type is |
Should be resolved by #279 in |
Environment
Node : v16.14.2
ofetch: "^1.3.2",
Reproduction
Describe the bug
After upgrading to version 1.3.2, the following error message appears. I can confirm that the error message does not appear in version 1.3.1.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: