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

**URL:** <https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286>\
**Category:** Other Apollo Topics\
**Tags:** federation\
**Created:** [May 20, 2023, 2:08am UTC](https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286 "2023-05-20T02:08:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sitho](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sitho](https://community.apollographql.com/u/Sitho)\
**Post date:** [May 20, 2023, 2:08am UTC](https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286/1 "2023-05-20T02:08:40Z")

</div>

Hi,

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.

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

const server = new ApolloServer({
  gateway
});

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Frantisek\_Koudelka](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/frantisek_koudelka/32/4302_2.png) [@Frantisek\_Koudelka](https://community.apollographql.com/u/Frantisek_Koudelka)\
**Post date:** [May 22, 2023, 4:34pm UTC](https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286/2 "2023-05-22T16:34:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sitho](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sitho](https://community.apollographql.com/u/Sitho)\
**Post date:** [May 22, 2023, 5:55pm UTC](https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286/3 "2023-05-22T17:55:11Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/this-cache-clear-is-not-a-function-after-moving-from-apollo-gateway-0-51-0-to-2-4-5/6286/4 "2025-02-06T20:48:50Z")

</div>


