#Next 16 + latest payload a lot of errors regarding lexical

4 messages · Page 1 of 1 (latest)

random briar
#

I get a lot of these, I'd say I have to restart after 2 out of 4 edits of code because the entire app crashes.

⨯ Error: Module [project]/node_modules/.pnpm/@payloadcms+richtext-lexical@3.79.0_@faceless-ui+modal@3.0.0_react-dom@19.2.4_react@19.116009b2a5ab4361249d3c0346dbb000/node_modules/@payloadcms/richtext-lexical/dist/exports/client/index.js [app-rsc] (client reference proxy) was instantiated because it was required from module [project]/node_modules/.pnpm/next@16.2.0-canary.85@babel+core@7.29.0_babel-plugin-react-compiler@1.0.0_react-dom@19_38801297f214ff3e8510b87bc20a074b/node_modules/next/dist/esm/build/templates/app-page.js?page=/(frontend)/(pages)/[slug]/page { MODULE_0 => "[project]/node_modules/.pnpm/next@16.2.0-canary.85_@babel+core@7.29.0_babel-plugin-react-...
...
dom@19_38801297f214ff3e8510b87bc20a074b/node_modules/next/dist/client/components/builtin/unauthorized.js [app-rsc] (ecmascript, Next.js Server Component)", MODULE_8 => "[project]/src/app/(frontend)/(pages)/[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.
at ignore-listed frames {
digest: '3629656571'
}

I am out of options. I'm starting to assume payload is not compatible with next 16 or what? Any pointers?

rocky current
#

currently its not recommended using payload in NextJS 16.

It is usable in NextJS 16 but like you have experienced, expect issues.

I'd stick with NextJS 15.4.11 untill payload offically uses NextJS16 in there templates

random brook
#

@rocky current He is using 16.2.0-canary.85 which should be supported.

@random briar In 3.79.0 lexical was updated from 0.35.0 to 0.41.0, is this a new project or a project you updated. If you updated your project there has been previous issues with older lexical versions is stuck in the lock file. I would try to delete your lock file and your node_modules and install dependencies again. And see if that helps.

See also https://payloadcms.com/docs/troubleshooting/troubleshooting#dependency-mismatches