fix: vercel 504 error

This commit is contained in:
Hk-Gosuto 2024-08-26 10:08:57 +08:00
parent 7a64266b9c
commit c64179950d
1 changed files with 7 additions and 3 deletions

View File

@ -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;