From 39d9cda17a2c7f357c128929a783e2ac96a9ece0 Mon Sep 17 00:00:00 2001 From: JOYCEQL <1449239013@qq.com> Date: Mon, 25 Nov 2024 20:47:16 +0800 Subject: [PATCH 1/2] fix: pdf font render --- apps/fronted/next.config.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/fronted/next.config.mjs b/apps/fronted/next.config.mjs index b149e34..287d345 100644 --- a/apps/fronted/next.config.mjs +++ b/apps/fronted/next.config.mjs @@ -3,8 +3,20 @@ const nextConfig = { typescript: { ignoreBuildErrors: true }, + // serverRuntimeConfig: { + // chromePath: process.env.CHROME_PATH + // }, serverRuntimeConfig: { - chromePath: process.env.CHROME_PATH + PROJECT_ROOT: __dirname + }, + webpack: (config, { isServer }) => { + if (isServer) { + config.externals.push("_http_common"); + } + return config; + }, + experimental: { + serverComponentsExternalPackages: ["puppeteer-core"] } }; From 01219dafaace4a209b133821c158bd9010567774 Mon Sep 17 00:00:00 2001 From: JOYCEQL <1449239013@qq.com> Date: Mon, 25 Nov 2024 20:52:29 +0800 Subject: [PATCH 2/2] fix: pdf font render --- apps/fronted/next.config.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/fronted/next.config.mjs b/apps/fronted/next.config.mjs index 287d345..99d2360 100644 --- a/apps/fronted/next.config.mjs +++ b/apps/fronted/next.config.mjs @@ -1,4 +1,9 @@ /** @type {import('next').NextConfig} */ +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); const nextConfig = { typescript: { ignoreBuildErrors: true