Compatibility with next-connect middlewares #728
Labels
area: integrations
contributions welcome
Good for people looking to contribute
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
I prefer to organize my middlewares with next-connect, however after installing next-intl I run into the following issue:
My
redirectMiddleware
did not trigger. I tried several different combinations trying to build a custom wrapper around the i18nMiddleware that normally looks like this:here is one example of the attempt:
https://github.com/hoangvvo/next-connect?tab=readme-ov-file#nextjs-middleware
but this was creating the following error:
It's my first time with
next-intl
so maybe I am missing smth obvious, but been bumping my head against this for few hours, and I can't figure it out, chat-gpt couldn't help as well 😅Describe the solution you'd like
router.use(i18nMiddleware, redirectMiddleware)
orrouter.use(i18nMiddleware).use(redirectMiddleware)
Describe alternatives you've considered
Currently I have this blob that works, but it's hard to look at it (that's why I want to decouple it with next-connect):
The text was updated successfully, but these errors were encountered: