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
When I use a malformed URL like /soga/ibiza% the app crashed with a
Error [URIError]: URI malformed
at decodeURI (<anonymous>)
at middleware (webpack-internal:///(middleware)/./node_modules/next-intl/dist/development/middleware/middleware.js:24:36)
at Object.middleware$1 (webpack-internal:///(middleware)/./src/middleware.ts:66:12)
I worked it around with the following portion in middleware.ts
Thanks for the report! After some local testing I found that Next.js might also return a 400 status code, maybe depending on if you have a segment like /[locale] where it tries to extract a segment from the pathname.
I've set up #1353 where the invalid request is simply forwarded, letting Next.js handle it. As far as I can tell, in invalid pathname never reaches the app, but is caught by the error handling of Next.js at some level.
Description
When I use a malformed URL like
/soga/ibiza%
the app crashed with aI worked it around with the following portion in middleware.ts
It also reproducible on the demo Repos :D
Verifications
Mandatory reproduction URL
https://next-intl-bug-repro-app-router.vercel.app/en/asdafa%
Reproduction description
Steps to reproduce:
Expected behaviour
Returns a 404, like NextJS normally does.
The text was updated successfully, but these errors were encountered: