-
Notifications
You must be signed in to change notification settings - Fork 87
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
preHandler
option is incorrectly typed
#319
Comments
Maybe has to be typed like I did in the changes in hooks.d.ts (unreleased afaik) |
Probably. Is that something unreleased for this module? Or somewhere else? |
This: |
Ahh so if that is published, then the existing type will work? |
I guess after this module is updated to the new version of Fastify too |
@Ethan-Arrowood this should be done now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Fastify version
4.21.0
Plugin version
9.2.1
Node.js version
20.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
NA
Description
The type for the
preHandler
(and assumingly thebeforeHandler
) options are slightly incorrect as they do not correctly infer support forasync
:TypeScript doesn't fail because I believe the current type satisfies the async version, but when you have ESLint enabled, ESLint complains that you are returning a promise where
void
is expected.We need to use the
preHandlerAsyncHookHandler
i think. I'll send a fix soon.Steps to Reproduce
na
Expected Behavior
na
The text was updated successfully, but these errors were encountered: