Next.js Discord

Discord Forum

Type error

Answered
Western thatching ant posted this in #help-forum
Open in Discord
Western thatching antOP
Hi πŸ‘‹! I am Trung. As you can see it is getting this type error. I am new. How do I fix that?
Answered by joulev
it should be
interface PageProps {
  params: Promise<{
    alias: string;
  }>
}

now
View full answer

13 Replies

@Western thatching ant Hi πŸ‘‹! I am Trung. As you can see it is getting this type error. I am new. How do I fix that?
it should be
interface PageProps {
  params: Promise<{
    alias: string;
  }>
}

now
Answer
Western thatching antOP
so I will add await
to params?
yeah
Western thatching antOP
@joulev Wait what?
oh
i am modify other first file
fr sry
yeah this one is in a different file
you need to migrate all files where you type params and searchParams
@joulev you need to migrate all files where you type `params` and `searchParams`
Western thatching antOP
thanks.