r/nextjs 2d ago

Help Consistent Runtime Error with Cache Components

Hi,

I'm migrating a Next.js 16 app from ISR to Cache Components, and I'm consistently running into this runtime error during development.

The pattern is always the same:

  • Everything works after starting the dev server.
  • After editing a page/template (or sometimes after CMS content changes), I start getting this runtime error.
  • The only way to recover is to restart the dev server.
  • Then it works again until the next change.

I'm using:

  • Next.js 16
  • Payload CMS 3.86
  • React 19

Has anyone run into something similar or have suggestions for where to investigate next?

A snippet of the error is given here.

Thanks
Matt

Module [project]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_next@1_3a6ac242312cb58507def477da89ede8/node_modules/@payloadcms/next/dist/exports/client.js [app-rsc] (client reference proxy) was instantiated because it was required from module

....

...

MODULE_9 => "[project]/src/app/(frontend)/[locale]/blogs/[slug]/page.tsx [app-rsc] (ecmascript, Next.js Server Component)" } [app-rsc] (ecmascript) <locals>, but the module factory is not available.
This is often caused by a stale browser cache, misconfigured Cache-Control headers, or a service worker serving outdated responses.
To fix this, make sure your Cache-Control headers allow revalidation of chunks and review your service worker configuration. As an immediate workaround, try hard-reloading the page, clearing the browser cache, or unregistering any service workers.

1 Upvotes

1 comment sorted by

0

u/AlexDjangoX 1d ago

You have a bug.

There is an error in your code.

Read the documentation.

Do a few tutorials.

Learn how to debug.