Next.js Discord

Discord Forum

Property 'generateMetaData' is incompatible with index signature.

Answered
Chinese perch posted this in #help-forum
Open in Discord
Chinese perchOP
I researched and found this is a type mismatch error? I am following https://www.youtube.com/watch?v=fqfer6xMp2A&ab_channel=CodinginFlow , at 1:58:36 .
Folder structure is given in the image.
Here is the page.tsx file, selected in the folder structure image, from which the error originates: https://gist.github.com/PrateekPathak9002/83517e2e1973d20e90529c4c9fe4756c
Complete error :
Type error: Type 'OmitWithTag<typeof import("E:/anshu/js3/framework/my-app-2/src/app/topic/[topic]/page"), "metadata" | "generateStaticParams" | "default" | "config" | "revalidate" | "dynamic" | "dynamicParams" | ... 4 more ... | "generateMetadata", "">' [x: string]: never; }'.
  Property 'generateMetaData' is incompatible with index signature.
    Type '({ params: { topic } }: PageProps) => Metadata' is not assignable to type 'never'.

   6 |
   7 | // Check that the entry is a valid entry
>  8 | checkFields<Diff<{
     |             ^
   9 |   default: Function
  10 |   config?: {}
  11 |   generateStaticParams?: Function

What might be the issue??
Answered by joulev
It’s generateMetadata not generateMetaData
View full answer

4 Replies