Next.js Discord

Discord Forum

Next.js TypeScript Build Error: Type 'OmitWithTagInput<FormProps, keyof PageProp>'

Answered
Cuckoo wasp posted this in #help-forum
Open in Discord
Cuckoo waspOP
Hello everyone,

I'm encountering some errors and could use your assistance in resolving them. The specific issue I'm facing is detailed in this Stack Overflow question:

https://stackoverflow.com/questions/78023507/next-js-typescript-build-error-type-omitwithtaginputformprops-keyof-pageprop

Your insights and guidance would be greatly appreciated. Thank you in advance for your help!
Answered by joulev
the file shouldn't be named page.js. name it something else, like input-form.js
View full answer

6 Replies

Answer
@joulev the file shouldn't be named `page.js`. name it something else, like `input-form.js`
Cuckoo waspOP
There is no relation of filename with error because I am having same error with different file in my project.
@Cuckoo wasp There is no relation of filename with error because I am having same error with different file in my project.
it very much has many relations with filenames. special files (page.js, layout.js, etc.) may only export certain things and those certain things may only have certain types. your input form is not a valid page, hence it fails. do not name it page.js.
@joulev Uhmmm soooo was that indeed the issue? Or how did you fix it?
Cuckoo waspOP
In my page there was various subcomponents which have their own folder and contain page.tsx of their own.These subscomponents had more subcomponent which also contains page.tsx but here was the typescript error of pageprops being thrown and when I changed the name error got fixed.