Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

fix: add rs canvas in outputFileTracingIncludes for Docker builds

Innei390335f567d9
diff --git a/src/libs/next/config/define-config.ts b/src/libs/next/config/define-config.ts
index a0a7cdd95e8..4a14c0e48b8 100644
--- a/src/libs/next/config/define-config.ts
+++ b/src/libs/next/config/define-config.ts
@@ -29,7 +29,25 @@ export function defineConfig(config: CustomNextConfig) {
const standaloneConfig: NextConfig = {
output: 'standalone',
- outputFileTracingIncludes: { '*': ['public/**/*', '.next/static/**/*'] },
+ outputFileTracingIncludes: {
+ '*': [
+ 'public/**/*',
+ '.next/static/**/*',
+ // Only needed for Docker standalone builds.
+ // On Vercel (serverless), including native bindings can easily exceed function size limits.
+ ...(buildWithDocker
+ ? [
+ // Ensure native bindings are included in standalone output.
+ // `@napi-rs/canvas` is loaded via dynamic `require()` (see packages/file-loaders),
+ // which may not be picked up by Next.js output tracing.
+ 'node_modules/@napi-rs/canvas/**/*',
+ // pnpm real package locations (including platform-specific bindings with `.node`)
+ 'node_modules/.pnpm/@napi-rs+canvas*/**/*',
+ 'node_modules/.pnpm/@napi-rs+canvas-*/**/*',
+ ]
+ : []),
+ ],
+ },
};
const assetPrefix = process.env.NEXT_PUBLIC_ASSET_PREFIX;