Skip to content

reproduction of skipMiddlewareUrlNormalize/middlware localization issue

Notifications You must be signed in to change notification settings

matthewcc/middlware-test

Repository files navigation

This is a minimum reproduction of a routing/localizaton issue with middleware.js. It was made with create-next-app.

If skipMiddlewareUrlNormalize in next.config.js is set to true, the value of nextUrl.locale in middlware.js is inaccurate while doing client site routing. It always shows the default locale.

To reproduce:

  1. Download this project, npm install, npm run dev, go to http://localhost:3000
  2. Navigate through the pages and locales using the links on the page
  3. Note that while navigating with the link or with the browser back/forward buttons, the CLI log from the middleware.js will show the default locale for nextUrl.locale (i.e., "en-US"), though the correct locale is part of the path nextUrl.pathname.

About

reproduction of skipMiddlewareUrlNormalize/middlware localization issue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published