Version 3 and before of Fastify are no longer maintained.
For information about support options for end-of-life versions, see the Long Term Support page.V4 Migration Guide
This guide is intended to help with migration from Fastify v3 to v4.
Before migrating to v4, please ensure that you have fixed all deprecation warnings from v3. All v3 deprecations have been removed and they will no longer work after upgrading.
Codemods
Fastify v4 Codemods
To help with the upgrade, we’ve worked with the team at Codemod to publish codemods that will automatically update your code to many of the new APIs and patterns in Fastify v4.
Run the following migration recipe to automatically update your code to Fastify v4:
npx codemod@latest fastify/4/migration-recipe
This will run the following codemods:
fastify/4/remove-app-usefastify/4/reply-raw-accessfastify/4/wrap-routes-pluginfastify/4/await-register-calls
Each of these codemods automates the changes listed in the v4 migration guide. For a complete list of available Fastify codemods and further details, see Codemod Registry.