Open alka7ex opened 1 year ago
I'm having a similar problem. my props has an optional parameter, but it doesn't make it through the build.
as such:
type Props = { parmas?: string | null; }
const Page = ({ parmas }: Props) => {...}
export default Page
I added over a layer of wraps and passed the build with no problem.
as such:
type SearchParams = { parmas?: string | null; }
type Props = { searchParams: SearchParams }
const Page = ({ searchParams: { parmas } }: Props) => {...}
export default Page
it happend same thing to me
it happend same thing to me, when I add to the layout.tsx. But I cannot fix it by changing it to the Page.tsx since it need to call something from the server side.
I just had something similar during the upgrade to Next 15. For me it was caused by 2 things in separate files:
searchParams
declaration from another file (layouts do not receive search params)params
prop as a Promise
(Next 15)
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/alka7ex/blog-typescript/blob/main/app/page.tsx
To Reproduce
when i try to hit npm run build i always get issues that there is something wrong with my app/page.tsx
Describe the Bug
i'm trying to build my own personal blog, using js is working perfectly but i want to use shadcn so i convert to use typescript, i fix everything in my code and following typescript guidance, there might be silly mistake, i'm still new. but when i
npm run build
, it keeps saying error :the error result is :
here is my code for app/page.tsx
Expected Behavior
i can do npm run build and it works perfectly, only when i try to build it, it not working. right now i'm skipping type check from next.config.js
Which browser are you using? (if relevant)
chrome
How are you deploying your application? (if relevant)
VPS managed by myself, OVH