I've identified the problem. Using require solves the issue, but you need to consider the synchronization and remove the async/await. Also, I used @fastify/[email protected], and I made sure from the changelog that it is compatible with Fastify 4.x."