Next.js Discord

Discord Forum

App directory [[...slug]] catch-all having trouble with root route via next/link

Unanswered
Pacific herring posted this in #help-forum
Open in Discord
Pacific herringOP
I am new and I did search but couldn't find this issue, so please forgive me if it has already been asked or answered.

My site works perfectly locally. When I deploy to Vercel, I have a strange error. The root route loads fine when I access the vercel domain. When I navigate to another page (via next/link), any page loads up fine... except the home page (root route). When I inspect, my links all seem to correctly be rendered having href="/" but I get a 404 when navigating to the page. A refresh of the 404 page then correctly loads the home page again.

Why can't I navigate home (/)?

I am exclusively using the app directory, and use an optional catch-all route ([[...slug]]) to route all of the pages of this dynamic site. Again, everything loads perfectly fine while running locally, I only experience this when looking at a Vercel deploy.

0 Replies