Different Layouts for The Index Page and The other pages ( 0B pages )
Answered
outdatedoutdatedoutdated posted this in #help-forum
So this is my folder structure, cause I wanted to different layouts for different pages so I just grouped these pages using
PS: I cant move the index layout to the root app folder cause of it will interfere with the info page and I want index and projects to share layout since projects is a shared component and I want it to be seamless which clicking on a project link.
( ) and created a index group and a information group but when I build the website it does not generate the page, As you can see in the second image all the route sizes are 0KB I think its cause of the index group it never generates a index page / what can I do to fix this PS: I cant move the index layout to the root app folder cause of it will interfere with the info page and I want index and projects to share layout since projects is a shared component and I want it to be seamless which clicking on a project link.
32 Replies
And still 0B for the index page.
I found this issue but there is no futher updates on these
Update: This problem seems persistent, I went thorugh the nextjs github issues page too there are multiple instances of the same issue with no solution, I just now switched over to
"next": "^13.4.8-canary.6", but seems like this also have no fix for it, although during the build time the index page was no longer 0B it still shows a 404 after deployment.@outdatedoutdatedoutdated So this is my folder structure, cause I wanted to different layouts for different pages so I just grouped these pages using `( )` and created a index group and a information group but when I build the website it does not generate the page, As you can see in the second image all the route sizes are 0KB I think its cause of the index group it never generates a index page `/` what can I do to fix this
PS: I cant move the index layout to the root app folder cause of it will interfere with the info page and I want index and projects to share layout since projects is a shared component and I want it to be seamless which clicking on a project link.
You must have an app/page.js or app/(something)/page.js or app/(smth)/(smth)/page.js… to have /
You don’t have any of those in your project structure
You only have /information and /projects/:slug which is reflected in the build log
@joulev You must have an app/page.js or app/(something)/page.js or app/(smth)/(smth)/page.js… to have /
The index group does have a page.tsx
@joulev Sorry sorta got hidden by a tooltip
but here
@joulev anything you can help me with would be really appreciated I can share the GitHub repo if you want to I really wanna push this website out
yes do share a reproduction repo
Could I have your email since it’s a private repo.
my email can be viewed in my github but i do not accept private code help. i don't read big repositories either. make a minimal reproduction repository/codesandbox/etc, make it public and send the link here
Oh alright I’ll do that. It’s fairly small
@joulev There you go
@outdatedoutdatedoutdated are you sure it is not creating the index page? because when i clone this and build it, i can see the index page just fine
in terms of project organisation it looks fine, the index page is
src/app/page.tsx and is built normally@joulev <@676036085708750860> are you sure it is not creating the index page? because when i clone this and build it, i can see the index page just fine
Well in dev it does but during a vercel deploy it doesnt.
This is a local build I did just now, the file size is still 0B
The 0B is a bug, but the route should still be there
I’m out rn, I will try to deploy that repo when I get back home
ðŸ‘ðŸ»
Answer
nothing wrong on my end
Oh word
Lemme try redploying the whole project
Ohk it weridly enough just worked
THANKS for all the help brother