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

Zones, Rewrites and Locales #23264

Closed
alexedwardjones opened this issue Mar 22, 2021 · 6 comments
Closed

Zones, Rewrites and Locales #23264

alexedwardjones opened this issue Mar 22, 2021 · 6 comments

Comments

@alexedwardjones
Copy link

Summary

I've followed the with-zones example for having multiple Next.js apps as different "zones" under the same domain using rewrites.

It works really well with the home app running on localhost:3000 and the blogs app running on localhost:4000.

localhost:3000 -> Index page of the home app ✅ 
localhost:3000/about -> About page of the home app ✅ 
localhost:3000/blog -> Index page of the blog app ✅ 
localhost:3000/blog/post/1 -> post/[id] page of the blog app ✅ 

I've then tried to add i18n to the example using next-i18next and it all gets a bit strange. For example if we have two locales for english and german which are en and de respectively. The routes within the home app work as expected.

localhost:3000 -> Index page of the home app in english ✅ 
localhost:3000/de -> Index page of the home app in german ✅ 
localhost:3000/about -> About page of the home app in english ✅ 
localhost:3000/de/about -> About page of the home app in german ✅ 

The rewrites to the blog app start getting weird and don't work as expected, presumably partially due to the basePath setting.

localhost:3000/blog -> Index page of the blog app in english ✅ 
localhost:3000/de/blog -> Index page of the blog app in english ❌ 
localhost:3000/blog/de -> Index page of the blog app in german but the URL doesn't match with "/de/about" ❌ 
localhost:3000/blog/post/1 -> post/[id] page of the blog app in english ✅ 
localhost:3000/de/blog/post/1 -> post/[id] page of the blog app in english ❌ 
localhost:3000/blog/de/post/1 -> 404 error ❌ 

Repo with issue

https://github.com/alexedwardjones/with-zones-and-i18n

Questions

  • Am I doing something wrong?
  • Is there anything I can do about this with the current configuration options?
  • If not, should I submit a bug or feature request? It seems more like a bug because the Next.js concept of zones doesn't support locales properly.

Originally posted by @alexedwardjones in #23198

@Alan-QK
Copy link

Alan-QK commented Mar 25, 2021

Do you resolove this problem?

@MitkoTschimev
Copy link

I have the same problem related to a subpath before the zones are starting.
We have a micro frontend architecture where every app is in a zone.
We are working only with SSG and the basePath is destroying the possibility at the moment.
We are not able to put the locale in front of the basePath

/en-us/app1/index.html
/en-us/app2/index.html

Maybe someone else found a solution?

@ckeeney
Copy link

ckeeney commented Apr 6, 2021

This is likely related (possibly a duplicate) of #21565

@sandra-goag
Copy link

I have the same issue, any ideas??

@balazsorban44
Copy link
Member

Duplicate of #21565

@balazsorban44 balazsorban44 marked this as a duplicate of #21565 Jan 25, 2022
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants