Skip to content

Commit 505f7a2

Browse files
yethikrishnaclaude
andcommitted
fix: use outputFileTracingRoot to resolve monorepo ENOENT on Vercel
Point output tracing to the monorepo root (parent of web/) so Vercel correctly resolves node_modules for @swc/helpers, @opentelemetry/api, and other hoisted dependencies during output tracing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5a2460b commit 505f7a2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

web/next.config.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import path from 'path'
2+
import { fileURLToPath } from 'url'
13
import createMDX from '@next/mdx'
24
import { withContentlayer } from 'next-contentlayer2'
35

6+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
7+
48
const withMDX = createMDX({
59
extension: /\.mdx?$/,
610
options: {
@@ -23,13 +27,12 @@ const nextConfig = {
2327
},
2428
allowedDevOrigins: DEV_ALLOWED_ORIGINS,
2529

30+
// Point output tracing to monorepo root so Vercel finds node_modules correctly
31+
outputFileTracingRoot: path.join(__dirname, '..'),
32+
2633
// Enable experimental features for better SSG performance
2734
experimental: {
2835
optimizePackageImports: ['@/components/ui'],
29-
// Exclude @opentelemetry/api from output tracing to avoid ENOENT in monorepo
30-
outputFileTracingExcludes: {
31-
'*': ['@opentelemetry/*'],
32-
},
3336
},
3437
webpack: (config) => {
3538
config.resolve.fallback = { fs: false, net: false, tls: false, path: false }

0 commit comments

Comments
 (0)