#Root returns 404 on Vercel with appDirectory
20 messages · Page 1 of 1 (latest)
thats not a good solution but for now maybe you can redirect / to /index maybe?
@vale spire I would like to understand why on local it works but not on Vercel? Super odd! How would you suggest that I can link / to /index?
this is an example i used before
async redirects() {
return [
{
source: "/",
destination: "/welcome",
permanent: true,
},
];
},
add to your nextjs config file
your source will be /
destination will be /index
I am confused to what does Vercel do differently than running next start locally?
Thank you @vale spire
I dont really faced a problem like this before, but what Im doing is redirecting or adding a useEffect hook to my main component that route.pushes to the source that I want
please let me know if it works
I renamed page.tsx that was mapping to /index and added it to /home/page,tsx so I have it on /home then I configured the redirects as you suggested in next.config.js to map / to /home
Thanks @vale spire !
It still doesn't resolve the original weird behaviour
yeah but you can coniniue development anyways 😅😅
Yes, but I am having lots of situations where local behaviour is different than deployed behaviour.
@vale spire we found the bug, it is related to the default localisation settings, details are here: https://github.com/vercel/next.js/discussions/41745#discussioncomment-4664792
Basically you need to remove form next.config.js the following:
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
And the default route start working again on Vercel