-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Async Dynamic APIs #8463
Comments
The workaround until we can issue a fix in Payload is to use |
I modified the
And it works fine now on the latest Next.js canary. But of course this can be overwritten at any point as mentioned in the file's comment, so not a permanent solution. |
@r1tsuu Is it still normal to get a warning after upgrading to Payload When opening the Payload admin, I get:
If I upgrade to the latest Next.js
|
I'm getting the same thing as @todor0v , I don't think it's a functional issue because the next team made the API backward compatible, but the console spam is a tad annoying. |
@r1tsuu I believe this issue is resolved as of @tomups It is a permanent solution, you change it once and if it is rewritten in the future, Payload will rewrite it using the correct newer syntax as long as you use beta version > @todor0v I am on |
@tomups 's solution is marked as a breaking change that you must implement to upgrade to beta.111. |
I still get the errors as well, even though I applied the changes suggested in the changelog. I also reinstalled node modules and deleted nextjs cache. Not sure what else I could try. edit: Oh, but I have custom views. I assume there is an issue with those. They all use
which is exported from payload. Could it be that the type here needs to be updated to reflect the changes regarding promises on params, searchParams, etc? |
@tyteen4a03, oh man, no idea how I overlooked that. After applying the changes everything works fine now, of course. Thanks for your hint. |
I'll look into this |
This shouldn't be an issue, since we await these before the custom view is rendered. |
This issue has been automatically locked. |
Link to reproduction
No response
Environment Info
Describe the Bug
As of Next.js v15.0.0-canary.171, the following change was introduced:
vercel/next.js#68812
You can read more about the change here:
vercel/next.js#68812
In short, it makes params / headers return promises so you have to await them. Its meant to also allow the previous approach for backwards compatability temporarily. However, it seems like this is not working as intended and it breaking
next build
(production builds).The errors stem from the
api/payload
folder.Example build error from
yarn build
:Example console errors during
yarn dev
:Reproduction Steps
payload
3.0.0-beta.109
andnextjs
15.0.0-canary.171
.yarn dev
/api/
route.yarn build
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: