Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update apollo-server-fastify packages for fastify v4 #6576

akylkb opened this issue Jun 15, 2022 · 3 comments

Update apollo-server-fastify packages for fastify v4 #6576

akylkb opened this issue Jun 15, 2022 · 3 comments


Copy link

akylkb commented Jun 15, 2022

The following error occurs

    throw new FST_ERR_PLUGIN_VERSION_MISMATCH(, requiredVersion, this.version)
FastifyError [Error]: fastify-plugin: fastify-accepts - expected '3.x' fastify version, '4.0.2' is installed
    at Object.checkVersion (/../node_modules/fastify/lib/pluginUtils.js:118:11)
    at Object.registerPlugin (/../node_modules/fastify/lib/pluginUtils.js:133:16)
    at Boot.override (/../node_modules/fastify/lib/pluginOverride.js:28:57)
    at Plugin.exec (/../node_modules/avvio/plugin.js:80:33)
    at Boot.loadPlugin (/../node_modules/avvio/plugin.js:273:10)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  statusCode: 500

I think need to update these packages to fix this error

Copy link

glasser commented Jun 17, 2022

See discussion at ea8578c#commitcomment-75998670

@fastify/accepts is a direct dependency of apollo-server-fastify. It looks like v3 and v4 of this package only work with Fastify v3 and v4 respectively, so it's not super clear to me how to publish a single version of apollo-server-fastify which works with either, even if we do assume that this is the only change needed to make ASF work with the new version of Fastify (and I have no idea if that's true). Unfortunately in AS3 the versions of the integration packages are tightly coupled to the versions of the core package so we can't just put out an apollo-server-fastify v4 and call it a day.

Soon, Apollo Server will have a simple stable web integration API and it'll be easy for Fastify experts to maintain apollo-server-fastify3 and apollo-server-fastify4 packages. For the time being, I suspect the best approach would be for a fastify user to put out your own apollo-server-fastify4 package that works with the AS3 API; while that API is complicated and not too stable, we hopefully won't change it much more before AS4 is out!

Copy link

Hey, any updates on this?
We stuck on nestjs v8 because of this issue.

Copy link

glasser commented Feb 28, 2023

@Valeronlol The Fastify integration for Apollo Server v4 supports Fastify v4:

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

3 participants