I have a route with a param (/src/pages/items/[id].tsx), and am testing the built-in i18n routing.
// next.config.js
module.exports = {
i18n: {
locales: [
'fr',
'en-US',
],
defaultLocale: 'fr'
}
};
The app renders correctly the page /en-US/items/0 in local. However, in production it returns a 404 (app hosted on Vercel). If I navigate to this url from within the app, it works correctly though. It really happens with routes with params, a page /en-US/items renders fine.
Is it a bug or I am doing something wrong ?
I got the same issue today. Hope this got fixed soon.
Hi, can you provide a reproduction showing the unexpected 404? We have tests for i18n and dynamic pages on Vercel which are currently passing as expected.
Experiencing the same issue. In my case I have the following folder structure: src/pages/company/[companyId].tsx. Visiting /company/[companyId] renders the correct page (with router.query.companyId being [companyId]), but visiting /company/1 results in a 404.
Hi, this should now be corrected, please re-deploy your application and give it a try!
Alright, it works now ! Thanks ! 馃敟馃敟馃敟
It seems like this is fixed only for Vercel deployments. I am still experiencing the same issue, running an application with next start.
Running yarn build && yarn start with this repro and visiting /post/1 directly results in a 404, but using the link to /post/1 from / renders the dynamic route.
The same app deployed to Vercel works as expected.
Reopening per https://github.com/vercel/next.js/issues/18397#issuecomment-722973992
This should be corrected for next start in the latest canary of Next.js v10.0.2-canary.5, please upgrade and give it a try!
Seems to work fine after upgrading. Thanks 馃帀
Most helpful comment
Alright, it works now ! Thanks ! 馃敟馃敟馃敟