Nextjs build failed because of old routes

Hi team, I'm literally stuck in my project, I have old routes that I can't remove to my list of route objects otherwise my build failed.
Here's my routes in prismicio.ts:

const routes: prismic.ClientConfig['routes'] = [
  {
    type: 'home',
    path: '/',
  },
  {
    type: 'page',
    path: '/:uid',
  },
  {
    type: 'room',
    path: '/room/:uid',
  },
];

I want to remove page and room routes, I remove them to my repository but if I remove them to my prismicio.ts I have the famous "[Error]: Prismic repository not found."
I have the same error if I add a route...

I have not error on next dev, only on next build.

Hi @m.azzeddine ,

It sounds like you need to refresh you next.js cache.

Thanks.

Thanks a lot @Phil, I delete the .next directory and re run build, it's fine now :pray:

You can find a good solution to that here for the future: