Skip to content

Commit 1e8533f

Browse files
committed
♻️ Upgrade the version of next.js to 15.5.7
1 parent 96a0c7e commit 1e8533f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

frontend/app/[locale]/layout.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,28 @@ import log from "@/lib/logger";
1616
const inter = Inter({ subsets: ["latin"] });
1717

1818
export async function generateMetadata(props: {
19-
params: Promise<{ locale: string }>;
19+
params: Promise<{ locale?: string }>;
2020
}): Promise<Metadata> {
2121
const { locale } = await props.params;
22+
const resolvedLocale = (["zh", "en"].includes(locale ?? "")
23+
? locale
24+
: "zh") as "zh" | "en";
2225
let messages: any = {};
2326

24-
if (["zh", "en"].includes(locale)) {
27+
if (["zh", "en"].includes(resolvedLocale)) {
2528
try {
2629
const filePath = path.join(
2730
process.cwd(),
2831
"public",
2932
"locales",
30-
locale,
33+
resolvedLocale,
3134
"common.json"
3235
);
3336
const fileContent = await fs.readFile(filePath, "utf8");
3437
messages = JSON.parse(fileContent);
3538
} catch (error) {
3639
log.error(
37-
`Failed to load i18n messages for locale: ${locale}`,
40+
`Failed to load i18n messages for locale: ${resolvedLocale}`,
3841
error
3942
);
4043
}
@@ -54,15 +57,20 @@ export async function generateMetadata(props: {
5457
};
5558
}
5659

57-
export default async function RootLayout(props: {
60+
export default async function RootLayout({
61+
children,
62+
params,
63+
}: {
5864
children: ReactNode;
59-
params: Promise<{ locale: string }>;
65+
params: Promise<{ locale?: string }>;
6066
}) {
61-
const { children, params } = props;
6267
const { locale } = await params;
68+
const resolvedLocale = (["zh", "en"].includes(locale ?? "")
69+
? locale
70+
: "zh") as "zh" | "en";
6371

6472
return (
65-
<html lang={locale} suppressHydrationWarning>
73+
<html lang={resolvedLocale} suppressHydrationWarning>
6674
<body className={inter.className}>
6775
<NextThemesProvider
6876
attribute="class"

frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"katex": "^0.16.11",
6262
"lucide-react": "^0.454.0",
6363
"mermaid": "^11.12.0",
64-
"next": "15.4.5",
64+
"next": "15.5.7",
6565
"next-i18next": "^15.4.2",
6666
"next-themes": "^0.4.4",
6767
"react": "18.2.0",
@@ -97,7 +97,7 @@
9797
"@types/react": "18.3.20",
9898
"@types/react-dom": "18.3.6",
9999
"eslint": "^9.34.0",
100-
"eslint-config-next": "15.5.0",
100+
"eslint-config-next": "15.5.7",
101101
"postcss": "^8",
102102
"tailwindcss": "^3.4.17",
103103
"typescript": "5.8.3"

make/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN if [ -n "$MIRROR" ]; then npm config set registry "$MIRROR"; fi && \
2222
"start": "NODE_ENV=production HOSTNAME=localhost node server.js"\
2323
},\
2424
"dependencies": {\
25-
"next": "15.4.5",\
25+
"next": "15.5.7",\
2626
"react": "18.2.0",\
2727
"react-dom": "18.2.0",\
2828
"http-proxy": "^1.18.1",\

0 commit comments

Comments
 (0)