#Type error: Type '{ params: { slug: string; }; }' does not satisfy the constraint 'PageProps'.

1 messages · Page 1 of 1 (latest)

fleet lotus
#

constantly receiving the error, tried fixing with ai and search, and npm run build returns always the same error:

Type error: Type 'BlogPageProps' does not satisfy the constraint 'PageProps'.
  Types of prperty 'params' are incompatible.
    Type '{ slug: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]

Next.js build worker exited with code: 1 and signal: null```

```tsx
import { BlogPost, getAllPosts, getPostBySlug } from "@/lib/blog"
import { BlogPostComponent } from "../../components/blog-post"
export async function generateStaticParams() {
  const posts = await getAllPosts()
  return posts.map(post => ({ slug: post.slug }))
}

export default async function BlogPage({ params }: { params: { slug: string } }) {
  const post: BlogPost | null = await getPostBySlug(params.slug)
  
  if (!post) {
    return <div>Post not found</div>
  }

  return (
    <main>
      <h1>{post.title}</h1> 
      <BlogPostComponent content={post.content} />
    </main>
  )
}```
tight gyroBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

fleet lotus
#

@fallen zealot any ideas?