This.cache.clear is not a function after moving from apollo gateway 0.51.0 to 2.4.5


I am moving my unmanaged federation from v1 to v2. I followed the docs and move to the latest gateway 2.x version. After this change, I started getting this.cache.clear is not a function error on startup. Any suggestions on why this is happening? I don’t use any cache related functionality that comes with the federation like APQ, response caching, etc. Adding the config I have as well and this is a nodejs 14.x lambda.

const gateway = new ApolloGateway({
  async supergraphSdl() {
      /* implementation */
  buildService({ url }) {
      /* implementation */

const server = new ApolloServer({


could you provide more detalis? perhaps the full error message you are getting

This is what I get, I don’t see the stacktrace and can’t reproduce locally.

An error occurred during Apollo Server startup. All GraphQL requests will now fail. The startup error was: this.cache.clear is not a function

I started downgrading to see if any other v2 version would work. When I went down to 2.3.x, error message changed to this.queryPlanStore.clear is not a function and the error was gone when I downgraded to v2.0.x.