-
-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.18.0
Plugin version
4.5.0
Node.js version
18
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Description
I can't define a plugin with options and done callback
import fp from "fastify-plugin";
export default fp(function Health(fastify, opts, done) {
fastify.get("/health", (req, res) => {
res.send();
});
});Results in TS7006: Parameter 'opts' implicitly has an 'any' type.
Steps to Reproduce
See description.
Workaround:
import fp from "fastify-plugin";
import { FastifyPluginCallback } from "fastify";
const plugin: FastifyPluginCallback = function Health(fastify, opts, done) {
fastify.get("/health", (req, res) => {
res.send();
});
done();
};
export default fp(plugin);Expected Behavior
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels