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
I get this error inside the console: GET https://[site-url]/undefined 404 (Not Found)
Is this a known issue, did i miss adding something maybe? I can't really find anyone else with this problem
routing.ts
import { createNavigation } from "next-intl/navigation";
import { defineRouting } from "next-intl/routing";
const locales = ["eng", "slo", "ita", "hrv", "bos"] as const;
export type EnabledLocale = (typeof locales)[number];
export const routing = defineRouting({
// A list of all locales that are supported
locales,
localePrefix: "always",
// Used when no locale matches
defaultLocale: "slo",
pathnames: {
"/": "/",
"/about": {
slo: "/o-nas",
eng: "/about",
ita: "/chi-siamo",
hrv: "/o-nama",
bos: "/o-nama",
},
"/contact": {
slo: "/kontakt",
eng: "/contact",
ita: "/contattaci",
hrv: "/kontakt",
bos: "/kontakt",
},
},
});
export const { Link, redirect, usePathname, useRouter, getPathname } =
createNavigation(routing);
export type Pathnames = keyof typeof routing.pathnames;
export type Locale = (typeof routing.locales)[number];
request.ts
import { getRequestConfig } from "next-intl/server";
import type { EnabledLocale } from "./routing";
import { routing } from "./routing";
export default getRequestConfig(async ({ requestLocale }) => {
// This typically corresponds to the `[locale]` segment
let locale = (await requestLocale) as EnabledLocale | undefined;
// Ensure that a valid locale is used
if (!locale || !routing.locales.includes(locale)) {
locale = routing.defaultLocale;
}
return {
locale,
messages: (await import(`../../messages/${locale}.json`)).default,
};
});
Verifications
I've verified that the problem I'm experiencing isn't covered in the docs.
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.
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.
As a side note, your locales are not valid. If you require non-standard locales as prefixes, you can consider setting up custom prefixes as necessary (next-intl will warn against invalid locales in the future).
I corrected the locales and the problems went away, thank you
I was trying to make the mapping easier as i get three letter locales from crowdin :D
thank you
Description
I get this error inside the console: GET https://[site-url]/undefined 404 (Not Found)
Is this a known issue, did i miss adding something maybe? I can't really find anyone else with this problem
routing.ts
request.ts
Verifications
Mandatory reproduction URL
https://pelicon-test-1.vercel.app/eng
Reproduction description
Navigate to the site, first error is the described one
Expected behaviour
Not getting this error, redirect shouldn't try to go to /undefined
The text was updated successfully, but these errors were encountered: