Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Vercel build was failing with TypeError: files.map is not a function due to incorrect fumadocs-mdx v11 API usage.

Changes

  • apps/site/lib/source.ts: Replace createMDXSource() with resolveFiles() to properly convert doc collections to VirtualFile[] array

The fumadocs-mdx v11 API requires using resolveFiles() to transform collections into the format expected by the loader's source.files property:

// Before
const mdxSource = createMDXSource(docs, meta);
export const source = loader({
  baseUrl: '/docs',
  source: { files: mdxSource.files() }  // ❌ files is not callable
});

// After
export const source = loader({
  baseUrl: '/docs',
  source: { files: resolveFiles({ docs, meta }) }  // ✅ returns VirtualFile[]
});
Original prompt

fix vercel

12:52:34.032 Running build in Washington, D.C., USA (East) – iad1
12:52:34.033 Build machine configuration: 4 cores, 8 GB
12:52:34.140 Cloning github.com/objectstack-ai/objectui (Branch: main, Commit: 64cd0a8)
12:52:34.582 Cloning completed: 442.000ms
12:52:35.764 Restored build cache from previous deployment (4WSsDmnKfxa3KS44pqYeFut9SFbY)
12:52:36.233 Running "vercel build"
12:52:37.081 Vercel CLI 50.4.5
12:52:37.435 Detected pnpm-lock.yaml 9 which may be generated by pnpm@9.x or pnpm@10.x
12:52:37.435 Using pnpm@10.x based on project creation date
12:52:37.435 To use pnpm@9.x, manually opt in using corepack (https://vercel.com/docs/deployments/configure-a-build#corepack)
12:52:37.474 Installing dependencies...
12:52:38.021 Scope: all 18 workspace projects
12:52:39.186
12:52:39.282 ╭ Warning ─────────────────────────────────────────────────────────────────────╮
12:52:39.282 │ │
12:52:39.282 │ Ignored build scripts: @vscode/vsce-sign@2.0.9, esbuild@0.21.5, │
12:52:39.282 │ esbuild@0.25.12, esbuild@0.27.2, keytar@7.9.0, sharp@0.34.5. │
12:52:39.282 │ Run "pnpm approve-builds" to pick which dependencies should be allowed │
12:52:39.282 │ to run scripts. │
12:52:39.282 │ │
12:52:39.283 ╰──────────────────────────────────────────────────────────────────────────────╯
12:52:39.289 Done in 1.7s using pnpm v10.28.0
12:52:39.314 Detected Next.js version: 15.5.9
12:52:39.348 Running "pnpm run build"
12:52:39.642
12:52:39.642 > @objectui/site@0.1.0 build /vercel/path0/apps/site
12:52:39.642 > next build
12:52:39.642
12:52:40.438 ▲ Next.js 15.5.9
12:52:40.438
12:52:40.777 [MDX] updated map file in 8.132980999999972ms
12:52:40.800 Creating an optimized production build ...
12:52:46.183 ✓ Compiled successfully in 4.9s
12:52:46.186 Linting and checking validity of types ...
12:52:47.929
12:52:47.930 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/app/api-reference/config/eslint#migrating-existing-config
12:52:47.931 (node:138) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///vercel/path0/eslint.config.js?mtime=1768884754468 is not specified and it doesn't parse as CommonJS.
12:52:47.931 Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
12:52:47.931 To eliminate this warning, add "type": "module" to /vercel/path0/package.json.
12:52:47.931 (Use node --trace-warnings ... to show where the warning was created)
12:52:48.650
12:52:48.650 ./app/docs/[[...slug]]/page.tsx
12:52:48.650 21:29 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
12:52:48.650 24:34 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
12:52:48.650 24:64 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
12:52:48.650 34:23 Warning: Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components. react-refresh/only-export-components
12:52:48.651 38:23 Warning: Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components. react-refresh/only-export-components
12:52:48.651
12:52:48.651 info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
12:52:49.447 Failed to compile.
12:52:49.448
12:52:49.448 ./lib/source.ts:10:22
12:52:49.448 Type error: This expression is not callable.
12:52:49.448 Type 'VirtualFile<{ pageData: DocOut<ZodObject<{ title: ZodString; description: ZodOptional; icon: ZodOptional; full: ZodOptional; _openapi: ZodOptional<...>; }, $strip>>; metaData: MetaOut<...>; }>[]' has no call signatures.
12:52:49.448
12:52:49.448 �[0m �[90m 8 |�[39m baseUrl�[33m:�[39m �[32m'/docs'�[39m�[33m,�[39m
12:52:49.448 �[90m 9 |�[39m source�[33m:�[39m {
12:52:49.448 �[31m�[1m>�[22m�[39m�[90m 10 |�[39m files�[33m:�[39m mdxSource�[33m.�[39mfiles()�[33m,�[39m
12:52:49.448 �[90m |�[39m �[31m�[1m^�[22m�[39m
12:52:49.449 �[90m 11 |�[39m }�[33m,�[39m
12:52:49.449 �[90m 12 |�[39m })�[33m;�[39m
12:52:49.449 �[90m 13 |�[39m�[0m
12:52:49.474 Next.js build worker exited with code: 1 and signal: null
12:52:49.518  ELIFECYCLE  Command failed with exit code 1.
12:52:49.537 Error: Command "pnpm run build" exited with 1


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 20, 2026 5:08am
objectui-site Ready Ready Preview, Comment Jan 20, 2026 5:08am

Request Review

@vercel vercel bot temporarily deployed to Preview – objectui-docs January 20, 2026 04:55 Inactive
@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – objectui-docs January 20, 2026 05:08 Inactive
Copilot AI changed the title [WIP] Fix issues with Vercel deployment Fix fumadocs-mdx API usage in site source loader Jan 20, 2026
Copilot AI requested a review from huangyiirene January 20, 2026 05:10
@huangyiirene huangyiirene marked this pull request as ready for review January 20, 2026 05:12
@huangyiirene huangyiirene merged commit b0041c4 into main Jan 20, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants