-
Notifications
You must be signed in to change notification settings - Fork 86
[Bug]: locales no longer working #1897
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
Comments
Thanks for the report. Can I confirm the steps:
Is that correct? |
That is correct. The url for booking.example.no was showing correctly as example.no/booking but the Swedish site was being shown and it was fetching data from the Swedish API which is controlled by an environment variable based on locale |
Sorry you've run into this issue! It is related to #1867 which was introduced in 4.30.0 and appears to be incorrectly matching root-level named locale pages as index pages. We are currently working on a fix and will update here when ready. |
@EmmaDawsonDev can I please confirm a few things about your booking site to help us diagnose the issue further?
|
Yes, both the apps have a single index.tsx page at the root and are using getStaticProps. The only thing different with the booking.example.se is that we use a basepath of /booking so that it becomes example.se/booking as the url for the index page of the booking app. The landing page has a redirect set up so that when the user presses the "Book now" button they are redirected from example.se to booking.example.se but the URL shows example.se => example.se/booking |
Thanks @EmmaDawsonDev, and just to be sure... are you using |
No, we're not currently using revalidate in either app. |
It turns out the error is not related to the fix I mentioned above as that fix went out in 4.30.1. I attempted to reproduce the error, without success, by creating a Next.js build with i18n, a single SSG index page and a basePath of 'booking' (I've assumed that the link from the first site is reaching the second site at https://booking.website.[country]/booking/[locale].html). At this point I'm not certain exactly what is causing the problem. Would it be possible to create a minimal reproduction repo for us to take a look at? |
Unfortunately it's quite a big project and I don't even know where to start in order to make a reproduction or have the time to set up all the hosting and env variables for the two apps. |
Hi @EmmaDawsonDev, we've not had any similar reports so unfortunately I can't identify it as a Runtime bug or diagnose it any further without a reproduction. Let me know if you are able to narrow it down in the future and we can take a deeper look. Please feel free to put a message on our support forum if you need further help. |
Summary
I work for a Nordic Company and we currently have our website on netlify composed of 2 next apps and it uses domain-based locales for Sweden, Norway, Finland and Denmark. website.se is the default, and website.no, website.fi and website.dk are all set up to show the locale-specific version of the site. These all route to the second next app when a user clicks a "Book Now" button where website.se/booking is the default and website.no/booking, website.fi/booking and website.dk/booking are the locales.
Everything was working fine. However, when we made a production release last week the next plugin for netlify updated to 4.30.0 from 4.29.4. This caused all our locales to default to the .se/booking site when a user clicked the "Book Now" button even though the url was still showing the correct domain locale and this prevented customers in Norway, Finland and Denmark from being able to make bookings.
We've currently rolled back to 4.29.4 but it would be good to know what the issue is that caused this, if there's some extra config needed on our end (everything is set up according to the nextJS i18n documentation) and not have to worry that updates to this plugin will cause issues for us in the future.
Steps to reproduce
This happened when we made a production release last week and the plugin updated to 4.30.0.
A link to a reproduction repository
No response
Next Runtime version
4.30.0
More information about your build
netlify.toml
)What OS are you using?
None
Your netlify.toml file
`netlify.toml`
Your public/_redirects file
`_redirects`
Your
next.config.js
file`next.config.js`
Builds logs (or link to your logs)
Build logs
Function logs
Function logs
.next JSON files
generated .next JSON files
The text was updated successfully, but these errors were encountered: