You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The NextRequestnextUrl provides other locale info (locale, defaultLocale, domainLocale - which does include locales), but is notably missing locales. This is useful information to have particularly in middleware which is handling rewrites and redirects.
…3) and use static values for now. next.config.js is not intended to be imported in this way. We should have access to locales directly in middleware in the future: vercel/next.js#37253
…1045)
* Remove import of next.config.js in redirects middleware (fixes #535263) and use static values for now. next.config.js is not intended to be imported in this way. We should have access to locales directly in middleware in the future: vercel/next.js#37253
* Add type assist jsdoc for NextConfig
Describe the feature you'd like to request
The
NextRequest
nextUrl
provides other locale info (locale
,defaultLocale
,domainLocale
- which does includelocales
), but is notably missinglocales
. This is useful information to have particularly in middleware which is handling rewrites and redirects.Describe the solution you'd like
Included the configured i18n locales under a
locales
prop onNextURL
so that it is accessible onNextRequest
in middleware. This would be in line with i18n config accessibility in other areas of the API.Describe alternatives you've considered
Duplicating configured locales in middleware code, or storing locales in common file.
The text was updated successfully, but these errors were encountered: