From 5da9bedf5cb16cfe7f9e970d3971b8ee4e79df29 Mon Sep 17 00:00:00 2001 From: Priyanshu Choudhary <57816400+Priyanchew@users.noreply.github.com> Date: Fri, 10 Apr 2026 00:54:03 +0530 Subject: [PATCH] fix(web): prevent nft EPERM on Windows home directory junction points Next.js nft (Node File Tracer) scans homedir() at build time and hits EPERM on Windows junction points (e.g. Application Data). Adds homedir()/** to TraceEntryPointsPlugin.traceIgnores on Windows server builds. --- packages/web/next.config.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/web/next.config.js b/packages/web/next.config.js index 85aaa6d42..a7f7a9454 100644 --- a/packages/web/next.config.js +++ b/packages/web/next.config.js @@ -1,4 +1,7 @@ +import os from "os"; + /** @type {import('next').NextConfig} */ +const homeDir = os.homedir().replace(/\\/g, "/"); const nextConfig = { serverExternalPackages: ["@composio/core"], transpilePackages: [ @@ -11,12 +14,27 @@ const nextConfig = { "@composio/ao-plugin-tracker-linear", "@composio/ao-plugin-workspace-worktree", ], - webpack: (config) => { + webpack: (config, { isServer }) => { if (process.platform === "win32") { config.snapshot = { ...config.snapshot, managedPaths: [/^(.+?[\\/]node_modules[\\/])/], }; + // Prevent nft from globbing the home directory during server file tracing. + // ao-core resolves paths like ~/.agent-orchestrator at runtime; nft tries to + // scan them at build time and hits EPERM on Windows junction points + // (e.g. C:\Users\\Application Data). + if (isServer) { + const tracePlugin = config.plugins.find( + (p) => p.constructor?.name === "TraceEntryPointsPlugin" + ); + if (tracePlugin) { + tracePlugin.traceIgnores = [ + ...(tracePlugin.traceIgnores ?? []), + `${homeDir}/**`, + ]; + } + } } return config; },