Skip to content
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

Example: Incremental adoption of App Router from Pages Router with next-intl #602

Closed
mohitb35 opened this issue Nov 7, 2023 · 3 comments
Labels
enhancement New feature or request unconfirmed Needs triage.

Comments

@mohitb35
Copy link

mohitb35 commented Nov 7, 2023

Is your feature request related to a problem? Please describe.

I'm trying to migrate to the app router - currently all pages in my app use the pages router.

I tried out the examples for app router and pages router individually and they worked. If I combine them however (which is required to do a gradual migration), things break.

I either run into a multiple redirect issue (when the locale is part of the url), or the locale detection does not seem to work.

Describe the solution you'd like

A minimal example you can provide to use app router and pages router simultaneously with next-intl would be useful.

Describe alternatives you've considered

I've searched for a possible solution within the next-intl docs , github issues on the next-intl repo, and stackoverflow, but have not found anything.

@mohitb35 mohitb35 added enhancement New feature or request unconfirmed Needs triage. labels Nov 7, 2023
@amannn
Copy link
Owner

amannn commented Nov 7, 2023

Update: The App Router migration example now shows a working approach.

See also: vercel/next.js#57704 (comment)

@mohitb35
Copy link
Author

mohitb35 commented Nov 8, 2023

Thanks for the quick response @amannn .

I'll be able to try this out only after 22nd Nov as I have a few urgent tasks to complete. Will get back if it works, or if I need some clarification.

@amannn
Copy link
Owner

amannn commented Nov 8, 2023

Sounds good! I'll close this ticket for the time being then, since we already have an example and the new docs will feature it more prominently. In case something doesn't work as expected, feel free to open a new issue!

@amannn amannn closed this as completed Nov 8, 2023
@amannn amannn changed the title Documentation/Example needed: Using Pages and App router simultaneously with next-intl Example: Incremental adoption of App Router from Pages Router with next-intl Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants