payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.58k stars 1.5k forks source link

Type error after upgrading to Nex.js v15.0.0-canary.171 #8472

Closed todor0v closed 11 hours ago

todor0v commented 1 day ago

Link to reproduction

No response

Environment Info

Payload: 3.0.0-beta.109
Node.js: 20.13.1
Next.js: 15.0.0-canary.173

Describe the Bug

After upgrading to the latest Next.js canary version, I get an error:

src/app/(payload)/api/[...slug]/route.ts
Type error: Route "src/app/(payload)/api/[...slug]/route.ts" has an invalid "GET" export:
  Type "{ params: { slug: string[]; }; }" is not a valid type for the function's second argument.

As mentioned in this Next.js PR:

params and searchParams are now promises

I fixed the same error when it comes to my Next.js code, but as advised, the Payload files are generated automatically and I should not modify them.

Reproduction Steps

Adapters and Plugins

No response

mobeigi commented 21 hours ago

This is a duplicate of https://github.com/payloadcms/payload/issues/8463

AlessioGr commented 11 hours ago

Closing in favor of https://github.com/payloadcms/payload/issues/8463