From c64179950dcd9a1747acea01611f56744ec9fbdd Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Mon, 26 Aug 2024 10:08:57 +0800 Subject: [PATCH] fix: vercel 504 error --- next.config.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index e13d80c0d..3fd18c7c3 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -6,8 +6,6 @@ console.log("[Next] build mode", mode); const disableChunk = !!process.env.DISABLE_CHUNK || mode === "export"; console.log("[Next] build with chunk: ", !disableChunk); -process.env.LANGCHAIN_CALLBACKS_BACKGROUND = true; - /** @type {import('next').NextConfig} */ const nextConfig = { webpack(config) { @@ -22,6 +20,12 @@ const nextConfig = { ); } + config.plugins.push( + new webpack.DefinePlugin({ + 'process.env.LANGCHAIN_CALLBACKS_BACKGROUND': JSON.stringify('true'), + }) + ); + config.resolve.fallback = { child_process: false, }; @@ -104,4 +108,4 @@ if (mode !== "export") { }; } -export default nextConfig; +export default nextConfig; \ No newline at end of file