From 83f3d0bc9d5d619c347b50f5226db1d089eb7df5 Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Fri, 5 Sep 2025 12:44:12 -0400 Subject: [PATCH] nextjs magic --- www/app/lib/edgeConfig.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/www/app/lib/edgeConfig.ts b/www/app/lib/edgeConfig.ts index 2c06dd06..96c94a56 100644 --- a/www/app/lib/edgeConfig.ts +++ b/www/app/lib/edgeConfig.ts @@ -29,9 +29,8 @@ export function edgeDomainToKey(domain: string) { // get edge config server-side (prefer DomainContext when available), domain is the hostname export async function getConfig() { if (process.env.NEXT_PUBLIC_ENV === "development") { - // helps to stop nextjs build from eager loading. don't inline it. - const configPath = "../../config"; - return require(configPath).localConfig; + // helps to stop nextjs build from eager loading. don't "require()" it + return (await import("../../config")).localConfig; } const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;