#404 on vercel if route to /

13 messages · Page 1 of 1 (latest)

finite pendant
#

hey, my app runs fine locally but if deployed to vercel I am getting 404 when I click a link routed to '/'. All other routes are working!

My folder structure is highly dynamic, fetching all pages from contentful and prerendering it. I grouped two static routes with the dynamic into a main group, see below...

Any idea why I this is happening?

tame stratusBOT
#

🔎 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)

finite pendant
#

I have an updated image of my folder structure:

#

And here is a screenshot of my build:

hollow matrix
#

well you dont have a / page

azure raft
#

What @hollow matrix said -> Put a page.tsx under the app folder

finite pendant
#

and then? The root page ('/') is supposed to be fetched dynamically... is this not possible?

#

in the pages directory I could have something like this:

#

its basically the same except of the (main) group which is considered to be not affecting the URL hierarchy

finite pendant
#

But it could be the root layout missing on app folder... I am gonna try this out!

#

hmm no that didnt help

#

its weird if I refresh the page it shows up

finite pendant
#

I digged a bit deeper into it and logged out my params on the pages... apparently the slug for the root on localhost is empty but on vercel its 'index'. I check the slug if its empty and then use / to ask contentful for data... if I have a slug '/' in contentful I get the page, but if data is empty I return a 404