diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 3d8b6021..c72f1376 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,18 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - + webpack: (config) => { + // This rule prevents issues with pdf.js and canvas + config.externals = [...(config.externals || []), { canvas: "canvas" }]; + + // Ensure node native modules are ignored + config.resolve.fallback = { + ...config.resolve.fallback, + canvas: false, + }; + + return config; + }, }; export default nextConfig;