Skip to content

Commit

Permalink
fix: missing await, missing type Promise (vercel#73088)
Browse files Browse the repository at this point in the history
Hi, Team.
It seems Promise is missing when defining params type.

---------

Co-authored-by: hyungji <[email protected]>
Co-authored-by: Maikel <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 4a203a0 commit 27961cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ export async function generateStaticParams() {
}

export default async function Page({ params }) {
const post = await fetch(`https://api.vercel.app/blog/${params.id}`).then(
(res) => res.json()
const { id } = await params
const post = await fetch(`https://api.vercel.app/blog/${id}`).then((res) =>
res.json()
)
return (
<main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export async function generateStaticParams({
export default function Page({
params,
}: {
params: { category: string; product: string }
params: Promise<{ category: string; product: string }>
}) {
// ...
}
Expand Down

0 comments on commit 27961cf

Please sign in to comment.