-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware not running in NX monorepo project, causing "Unable to find next-intl
locale" error
#1171
Comments
I have that same problem |
I encountered the same error. It occurs when I use a private window without specifying "/en" (or another language code) in the URL to initialize the variable. If I make the first request with "/en" (or the appropriate language code) in the URL, it works perfectly afterward. (Hope my example will help to find where the error comes from) |
Thank you for your report! Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically. Templates: Creating a good bug report takes time. To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you. Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Thank you for your understanding! FAQ"I've included a reproduction, what is missing?" This comment might have been added because your reproduction doesn't point to a destination where the issue can be reproduced. Please make sure that the latest changes were saved in the reproduction and that the link is correct. |
I would like to clarify that I have already added a link to a repository that reproduces the bug in my original issue report. The reproduction can be found at here |
I was unfortunately not able to reproduce the issue in the reproduction you've provided. These are the steps I took:
I can't see an issue there. To be able to help with this, can you provide reproduction steps on how the issue can be reproduced in your reproduction repo? |
Thank you for taking the time to test the reproduction. I apologize for the confusion. It seems I wasn't clear enough in describing the issue. Let me provide more specific steps to reproduce the problem: Follow the steps you've already taken (1-4). You should then encounter the following error:
|
Additionally, I've just discovered that if we remove the
How should we address this issue? |
Have a look at the error files guidelines in the docs, that should help! I’m on vacation now for a few weeks, hope this helps to resolve your issue. If not, happy to catch up when I’m back! |
This issue has been automatically closed because it is currently not actionable and has become stale. If the problem persists, please create a new issue. |
Description
Hi, I'm experiencing an issue with next-intl in an NX monorepo project. When following the official "With i18n router" setup instructions, I consistently encounter the following error:
"Unable to find
next-intl
locale because the middleware didn't run on this request."Here are the key points:
My setup:
Could this be related to how NX handles Next.js projects or middlewares? Any insights or suggestions would be greatly appreciated. Thank you!
Verifications
Mandatory reproduction URL
https://github.com/testBP0612/next-intl-nx-bug-repro
Reproduction description
Steps to reproduce:
Expected behaviour
The middleware should run, and for unsupported locales, it should execute the
notFound
function imported from 'next/navigation'.Actual behavior:
The middleware doesn't seem to run, resulting in the "Unable to find
next-intl
locale" error. ThenotFound
function is not being called for unsupported locales.The text was updated successfully, but these errors were encountered: