next-runtime icon indicating copy to clipboard operation
next-runtime copied to clipboard

Middleware does not match when using basePath and default locale

Open serhalp opened this issue 1 year ago • 0 comments

A pages router site with both basepath and i18n enabled does not match middleware targeted at the root unless a locale is in the URL. It should match when using the default locale

Demo:

  • https://6634b69452829cd391cab206--next-e2e-tests.netlify.app/root/ does not have x-from-middleware header
  • https://6634b69452829cd391cab206--next-e2e-tests.netlify.app/root/en/ does have x-from-middleware header

Data

The following is parsed automatically by the Next.js repo e2e test report generator.

test: test/e2e/middleware-matcher/index.test.ts reason: Middleware does not match when using basePath and default locale

serhalp avatar Jun 13 '24 21:06 serhalp