Self-host Anuphan font instead of next/font/google
The Coolify build server has no outbound access to fonts.googleapis.com, which crashed `npm run build` inside the Docker build with a next/font google-loader TypeError. Switch to next/font/local with the variable TTF fetched from the Google Fonts GitHub repo (same OFL-licensed font, no build-time network dependency). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+6
-4
@@ -1,11 +1,13 @@
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import { Anuphan } from "next/font/google";
|
||||
import localFont from "next/font/local";
|
||||
import { ServiceWorker } from "@/components/ServiceWorker";
|
||||
import "./globals.css";
|
||||
|
||||
const anuphan = Anuphan({
|
||||
subsets: ["thai", "latin"],
|
||||
weight: ["400", "500", "600", "700"],
|
||||
// Self-hosted (not next/font/google): the Coolify build server has no egress
|
||||
// to fonts.googleapis.com, which crashed `npm run build` there.
|
||||
const anuphan = localFont({
|
||||
src: "./fonts/Anuphan-Variable.ttf",
|
||||
weight: "100 700",
|
||||
variable: "--font-anuphan",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user