Closed EnergeticPixels closed 1 month ago
Hi, thanks for reading the book.
The FSTWRN002
warning spots wrong plugin interface declaration such as:
// async function with next
async function plugin(fastify, opts, next) {}
// sync function and missing `next`
function plugin(fastify, opts) {}
If I remove the "next" callback, the warning does not display.
I assume the plugin function is an async function, for this reason removing the next
callback argument is correct.
In the book I checked that the spelling is correct and the warning is not there:
@Eomm @mcollina,
I have been trying to follow the book as I am learning many things I wish I had before diving into my own Fastify backend. I ran into a Fastify warning FSTWRN002 in Chapter 8. It was sourced to the loader.js. If I remove the "next" callback, the warning does not display.
The warning I am getting: (node:12133) [FSTWRN002] FastifyWarning: The application-schemas plugin being registered mixes async and callback styles, which will result in an error in
fastify@5
File in question: Chapter 8/schemas/loader.js