Support Fastify v5
Closed this issue · 3 comments
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
Publishable key
pk_test_Zml0dGluZy15YWstOTguY2xlcmsuYWNjb3VudHMuZGV2JA
Description
When installing fastify v5, the backend immediately crashes with the following error:
[08:51:11 UTC] ERROR: fastify-plugin: @clerk/fastify - expected '4.x' fastify version, '5.0.0' is installed
err: {
"type": "FastifyError",
"message": "fastify-plugin: @clerk/fastify - expected '4.x' fastify version, '5.0.0' is installed",
"stack":
FastifyError: fastify-plugin: @clerk/fastify - expected '4.x' fastify version, '5.0.0' is installed
"code": "FST_ERR_PLUGIN_VERSION_MISMATCH",
"name": "FastifyError",
"statusCode": 500
}
Environment
-
Having the same issue
Hi, thanks for the issue. The error comes from
javascript/packages/fastify/src/clerkPlugin.ts
Lines 26 to 29 in c49eaa7
The migration guide is here for reference: https://fastify.dev/docs/latest/Guides/Migration-Guide-V5/
For example, they now require Node.js 20 whereas the Clerk package allows 18.17.0 or later. So we'll need to cut a new major version in doing this upgrade. We'll work on it 👍
Support for Fastify v5 has been added in @clerk/fastify@2.0.0
. Please note that it's not backwards-compatible with Fastify v4, you will have to use Fastify v5.