Comments (8)
I have that same problem
from next-intl.
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)
from next-intl.
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.:
- Open reproduction
- Click on …
- See error: …
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.
from next-intl.
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
from next-intl.
I was unfortunately not able to reproduce the issue in the reproduction you've provided.
These are the steps I took:
- Clone the repo
npm i
npx nx run next-app:dev
- Open http://localhost:3000
- The server redirects to
/en
- "Hello!" is displayed
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?
from next-intl.
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).
Instead of allowing the redirect to /en
, try navigating directly to any other path, for example: http://localhost:3000/123
You should then encounter the following error:
Unable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.
from next-intl.
Additionally, I've just discovered that if we remove the <html /> + <body />
tags from app/layout
, it causes the 404 page to break. However, if we keep these tags, we encounter an error message for other languages, such as:
Warning: Prop lang did not match. Server: "en" Client: "zh-TW"
How should we address this issue?
You can refer to my other branch: bug/lang
to reproduce this problem.
from next-intl.
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!
from next-intl.
Related Issues (20)
- Switching language in sub-routes with dynamic routes throws an error HOT 6
- Importing createMiddleware() doesn't work as the tutorial suggests in type:module packages HOT 3
- Convenience injection of rewrites & exportPathMap HOT 3
- Domain based routing problem. HOT 2
- Verbose `localePrefix` does not redirect to the custom prefix HOT 3
- Allow for handling optional/invalid numbers on plural interpolation HOT 1
- Googlebot doesn't receieve translations HOT 2
- There is a problem with translation when the language family name has Hyphen HOT 1
- [Docs]: It is not clear to add pathnames to middleware file if you want to use localized pathnames HOT 1
- `redirect` from `createSharedPathnamesNavigation` doesn't handle relative paths HOT 1
- No default component was found HOT 1
- Allow usage of markup in addition to rich values in defaultTranslationValues HOT 3
- No any logic for `trailingSlash: true` HOT 5
- Inability to override locale on Date formatting results in incorrect localization HOT 2
- Using a multiples json in aplication HOT 1
- Router.replace from createLocalizedPathnamesNavigation causes infinite render HOT 1
- Open redirect vulnerability exposed when `localePrefix: 'as-needed'` HOT 1
- [Docs]: Confused about 2 domains HOT 2
- Build Error from the main core file. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-intl.