-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Cant get 404 working from the documentation example #434
Comments
This is quite strange. I see that If you debug the request like so: import createMiddleware from "next-intl/middleware";
const middleware = createMiddleware({
// A list of all locales that are supported
locales: ["en", "de"],
// If this locale is matched, pathnames work without a prefix (e.g. `/about`)
defaultLocale: "en",
});
export default function handler(request) {
const response = middleware(request);
console.log(response);
return response
}
export const config = {
// Skip all paths that should not be internationalized. This example skips the
// folders "api", "_next" and all files with an extension (e.g. favicon.ico)
matcher: ["/((?!api|_next|.*\\..*).*)"],
}; You see this on the console:
Something seems fishy here, quite possibly on the Next.js side, as this used to work in earlier versions. Maybe you can further reduce the example, possibly by removing Note that there is generally a bug with not-found pages currently in Next.js: #423 As a temporary workaround, you might want to downgrade Next.js to the latest version that has been tested in this repo (13.4.7). |
Thank for looking at it. I removed the next-intl and then opened |
Why does the page get rendered when a not-found page should match? Did you add a middleware with a rewrite to a localized path, so that the |
With [email protected], directly visiting /en/abc from browser (not navigating from within the application) renders the non-found page without any Layout. Everything works with 13.4.7, as long as the path is matched by the middleware to set the language (or with a default) |
Do we have any update on this ? I am facing the same issue. |
I just looked at the reproduction from @Tomekmularczyk and was able to fix it with the most recent Next.js version. It seems like the issue could be resolved by removing the root layout: amannn/next-intl-404@8abfbc2 The issue in the example was that both the root layout, as well as the nested layout tried to render Do note though that newer Next.js versions have a related issue for not found pages though: #423 (this needs to be fixed on their end). |
Problem is still here with very latest version |
Actually this seems to be fixed for me with the latest version of me the 13.5.2 |
Description
I'm trying to create a not-found page but cannot access it. I tried stable and beta configuration steps.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://github.com/Tomekmularczyk/next-intl-404
Reproduction description
Steps to reproduce:
Expected behaviour
I should see a page from not-found.tsx file
The text was updated successfully, but these errors were encountered: