Page /[locale]/(home)/page is missing param /favicon.ico in generateStaticParams() - output: exports
Unanswered
Mini Satin posted this in #help-forum
Mini SatinOP
I am currently using export output and I made translations to my app where the data comes from a CMS, but I am getting this error, but everything work as expected.
my root page redirects to the first language
and my root page from [locale]/(home)/page have this generateStaticParams
But I already set the favicon in my head and on my generateMetadata tag in my root layout
What am I doing wrong?
my root page redirects to the first language
import { getLanguages } from "@/services/languages";
import { RedirectType, redirect } from "next/navigation";
export default async function page() {
const languages = await getLanguages();
const mainLanguage = languages[0].language_code;
redirect(mainLanguage, RedirectType.replace);
}and my root page from [locale]/(home)/page have this generateStaticParams
export async function generateStaticParams() {
const languages = await getLanguages();
return languages.map((language) => ({
locale: language.language_code,
}));But I already set the favicon in my head and on my generateMetadata tag in my root layout
export async function generateMetadata(): Promise<Metadata> {
const { darkIcon, description, lightIcon, title } = await getMetadata();
const icon = [
{
media: "(prefers-color-scheme: dark)",
url: lightIcon?.value || "/assets/favicon-light.svg",
href: lightIcon?.value || "/assets/favicon-light.svg",
},
{
media: "(prefers-color-scheme: light)",
url: darkIcon?.value || "/assets/favicon-dark.svg",
href: darkIcon?.value || "/assets/favicon-dark.svg",
},
];
return {
title: {
template: "%s | Proccedure",
default: "Proccedure",
absolute: title?.value,
},
description: description?.value,
icons: {
icon,
},
};
}
{...}
<head>
<link rel="icon" href="/favicon-dark.ico" sizes="any" />
</head>What am I doing wrong?