Build failure persists with params
as Promise in Next.js App Router, possibly related to locale handling
#8712
Replies: 1 comment 9 replies
-
Hi @danielkoller — this is an issue with your project's TypeScript (and Next.js) and not related to Payload itself. We try and retain our GitHub issues to only be used for bugs / issues with Payload itself, so I will convert this to a Q&A Discussion. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Link to reproduction
No response
Environment Info
Payload: 3.0.0-beta.113
Node.js: 22.9.0
Next.js: 15.0.0-canary.173
Describe the Bug
Despite implementing the suggested changes from issue #8463, the build process continues to fail when using Payload CMS with Next.js App Router. The problem seems to be related to how
params
is being passed to page components and metadata generation functions. I suspect that the handling of thelocale
parameter might be contributing to this issue.When trying to run the build, I get this error ->
Type error: Type '{ params: { locale: string; }; }' does not satisfy the constraint 'PageProps'. Types of property 'params' are incompatible. Type '{ locale: string; }' is missing the following properties from type 'Promise<SegmentParams>': then, catch, finally, [Symbol.toStringTag]
Here is my localized [slug]-page handling the pages created via Payload CMS.
Reproduction Steps
Set up a Next.js project with App Router and Payload CMS integration.
Implement internationalization (i18n) in your Next.js app with Next-Intl.
Create a dynamic route file for handling pages created via Payload CMS, e.g.,
app/[locale]/(frontend)[slug]/page.tsx
.In this file, implement the page component and metadata generation as follows:
Ensure that your
next.config.js
is properly configured for i18n and Payload CMS.next build
to start the build process. It fails with this error ->Adapters and Plugins
No response
Beta Was this translation helpful? Give feedback.
All reactions