最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

nextjs14 - Going from Next.js 14 to 15 - Stack Overflow

programmeradmin0浏览0评论

I am facing a problem going from Next.js 14 to Next.js 15.

Here is the code that was working up to now and for which I get an error with Next.js 15:

...

interface pageProps {
    params: {
        rcdId: string
    }
}

...

export default function GPSFix({params: {rcdId}}: pageProps) {
  ...
})

This is the error I get:

app/GPSFix/[rcdId]/page.tsx
Type error: Type 'pageProps' does not satisfy the constraint 'PageProps'.
  Types of property 'params' are incompatible.
    Type '{ rcdId: string; }' is missing the following properties from type     'Promise<any>': then, catch, finally, [Symbol.toStringTag]

I have tried many ways, based on what I could find in some documents related to upgrading to Next.js 15, to change the code in the line:

export default function GPSFix(...)

but with no success to make it work.

Does anyone see the proper way to update my code?

发布评论

评论列表(0)

  1. 暂无评论