-
Notifications
You must be signed in to change notification settings - Fork 26.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Router page with data fetching returns 404 in combination with the i18n setup #51009
Comments
Would be nice to append these labels: area: Routing |
Thanks for finding this, I had no idea this is what was causing my 404s! |
After further debugging this, I found that it returns 404 for all pages using server components with async fetch when configuring our app with i18n. I updated my example with a page called /favorite that is fetching the data for my favorite (Pikachu).
I would really like to keep the i18n support, and I guess this is supposed to work. Any ideas on how we can solve this without removing the i18n configuration? |
So I did some more research and in the app-router-migration you can find this information: "The locale, locales, defaultLocales, domainLocales values have been removed because built-in i18n Next.js features are no longer necessary in the app directory. Learn more about i18n." I followed this example to test the new setup without these old values(config) and it works as expected. The challenge I have now is using this new setup together with the old configuration to support i18n in both |
In the /pages context, I am using getStaticPaths to predefine some dynamic pages. After removing the old i18n config this now fails when building: |
We ended up removing the i18n configuration that we used in the context of our pages when fetching data I guess it would be nice to support the combination to make the transition to using App Router as smooth as possible 🤷♂️ Anyhow this is the end of my monologue 😂 |
I have the same issue, I was getting crazy. Im just going to comment the intl for the momment |
same issue here... can't comment |
Hello, thank you for reporting this. This issue currently also blocks us from partially migrating some of our routes to the new app router. So we either to a all or nothing approach, which is not really something we're confident doing (as it will also take a long time). It'd be great if someone could share some details if this is going to be fixed. |
I'd like to add that this does not only happen if you have a page with data fetching. I created a reproduction repository, where the routing is broken when the app route exposes a
If you remove Edit: The bug is also present in next.js 14 |
This issue still occur in 14.0.3 |
Do we have any progress here? We experience same issue on 14.1.1 as well. |
Apparently I still have this error, year after... |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:58 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6020 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: N/A pnpm: N/A Relevant packages: next: 13.4.6-canary.0 eslint-config-next: 13.4.4 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Internationalization (i18n), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/torleifhalseth/my-app
To Reproduce
Describe the Bug
The page return 404 on Vercel.
Locally it works as expectet both when running
npm run dev
andnpm run build
+npm run start
Here is the preview of the application reproducing the issue:
https://my-app-torleif.vercel.app/
Here is a page using async await to fetch data in server component:
https://my-app-torleif.vercel.app/favorite
Here is the deployment data from Vercel:
![Screenshot 2023-06-13 at 15 09 26](https://private-user-images.githubusercontent.com/2523381/245485968-039f4e74-d86c-4243-80d1-5a76ddb1737d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMzQ2OTYsIm5iZiI6MTcyMjAzNDM5NiwicGF0aCI6Ii8yNTIzMzgxLzI0NTQ4NTk2OC0wMzlmNGU3NC1kODZjLTQyNDMtODBkMS01YTc2ZGRiMTczN2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjZUMjI1MzE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDQ0MTBhMWY2NDhmODE3OTdjNTM4YmE2Yzg4MzFmMDBiZWEwMTNiYTUzOTczMjBhYjUwNDhjODg1NzdkMTkyMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._CpOTrzDeTDNm3QxjFnQT1kiSUT5qdeEigtzwnGbrLg)
Screenshot from the error in Vercel logs:
![Screenshot 2023-06-09 at 09 03 17](https://private-user-images.githubusercontent.com/2523381/244617467-d6d7512c-00b2-4ebd-9b4a-035a6809b91a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMzQ2OTYsIm5iZiI6MTcyMjAzNDM5NiwicGF0aCI6Ii8yNTIzMzgxLzI0NDYxNzQ2Ny1kNmQ3NTEyYy0wMGIyLTRlYmQtOWI0YS0wMzVhNjgwOWI5MWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjZUMjI1MzE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDlkZDA1ZTRjZWUwYWM4NTVhNTdlMmIxYjhmZjc3ZDI2OWJjOWRmOTkzNTkwYTZiMjA0OGNhMmI5NzNiYWI1NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.5mfMwonPs4L0EfweOfGe7mgFNb-h9TzwpFpUnW6Kmcs)
This PR with the related issues looks very related, but the problem persists when deployed to Vercel for some reason.
#47429
Expected Behavior
Expect the page to return the page with data.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
The text was updated successfully, but these errors were encountered: