From 2f030deb42e537ff079f304cd0ef4b82fc55eca2 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 31 Jul 2026 14:33:33 +0200 Subject: [PATCH] fix: switch Google Fonts to runtime tags for build environments without internet - Replace next/font/google with tags in (loads fonts client-side at runtime) - Define --font-nunito and --font-pixel CSS variables in globals.css with font-family fallbacks - Remove @prisma/client from serverExternalPackages in next.config.ts (devDep only) --- next.config.ts | 2 -- src/app/globals.css | 5 +++++ src/app/layout.tsx | 27 +++++++++++---------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/next.config.ts b/next.config.ts index 61c17d9a..dd29a849 100644 --- a/next.config.ts +++ b/next.config.ts @@ -22,9 +22,7 @@ const securityHeaders = [ const nextConfig: NextConfig = { turbopack: {}, serverExternalPackages: [ - "@prisma/adapter-mariadb", "mariadb", - "@prisma/client", "lzma", "sharp", "pino", diff --git a/src/app/globals.css b/src/app/globals.css index c8d036c1..d0f6a87f 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -4,6 +4,11 @@ @plugin "tailwindcss-animate"; @custom-variant dark (&:where(.dark, .dark *)); +:root { + --font-nunito: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; + --font-pixel: "Pixelify Sans", monospace; +} + @theme { --font-sans: var(--font-nunito), "Nunito", ui-sans-serif, system-ui, -apple-system, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 004c085a..cf2c39ce 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,4 @@ import type { Metadata } from "next"; -import { Nunito, Pixelify_Sans } from "next/font/google"; import { headers } from "next/headers"; import Script from "next/script"; import { NextIntlClientProvider } from "next-intl"; @@ -15,20 +14,6 @@ import { resolveHotelName } from "@/lib/hotel-name"; import { siteSettings } from "@/lib/services/site-settings"; import "./globals.css"; -const nunito = Nunito({ - subsets: ["latin"], - weight: ["400", "600", "700", "800"], - display: "swap", - variable: "--font-nunito", -}); - -const pixelFont = Pixelify_Sans({ - subsets: ["latin"], - weight: ["400", "700"], - display: "swap", - variable: "--font-pixel", -}); - export async function generateMetadata(): Promise { const appUrl = process.env.APP_URL ?? "http://localhost:3000"; const hotel = await resolveHotelName(); @@ -69,10 +54,20 @@ export default async function RootLayout({ return ( + + + +