Next.js 15 async API changes and their impact on Payload CMS admin files #10816
Unanswered
wilbertcaba
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’ve been using Payload CMS v3 Beta since its initial release for a personal website. As new versions with breaking changes are introduced, I’ve been gradually updating my project, addressing each issue along the way until I reach v3 stable. I have successfully upgraded to version
v3.0.0-beta.117
, which requires Next.js15.0.0
.During this upgrade, I noticed that Next.js now enforces the use of async/await with the
cookies()
andparams
APIs for better performance, which were previously used synchronously in my projectTo facilitate this transition, Next.js provides a codemod:
$ npx @next/codemod@canary next-async-request-api .
This codemod effectively updates most instances where these APIs are used, making the necessary changes automatically. However, I noticed that it also attempts to modify Payload's admin page.tsx file, located at:
src > app > (payload) > admin > [[...segments]] > page.tsx
The current state of the
page.tsx
file onv3.0.0-beta.117
is:After running the codemod, it modifies the file to the following version, but it omits the correct types:
Since this file is auto-generated by Payload, I have decided not to commit these changes to avoid modifying core files. However, I’m curious—will this be something that Payload addresses in an upcoming update for full Next.js 15 compliance?
@jmikrut
Beta Was this translation helpful? Give feedback.
All reactions