Skip to content

[WIP] Fix module not found error for fumadocs-ui card component#327

Merged
hotlong merged 3 commits intocopilot/improve-zod-protocol-displayfrom
copilot/fix-module-not-found-error
Jan 27, 2026
Merged

[WIP] Fix module not found error for fumadocs-ui card component#327
hotlong merged 3 commits intocopilot/improve-zod-protocol-displayfrom
copilot/fix-module-not-found-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 27, 2026

  • Explored the repository structure
  • Identified the root cause: MDX files have unnecessary imports for fumadocs-ui components
  • Added Tab and Tabs components to the components object in page.tsx
  • Removed unnecessary fumadocs-ui component imports from all 449 MDX files
  • Fix lucide-react module resolution for Turbopack
  • Test the build to verify the fix
Original prompt

拉取请求: #325

22:42:18.992
Module not found: Can't resolve 'fumadocs-ui/components/card'
22:42:18.992
101 | }]
22:42:18.992
102 | };
22:42:18.992

103 | import {Card, Cards} from 'fumadocs-ui/components/card';
22:42:18.992
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22:42:18.992
104 | import {Tab, Tabs} from 'fumadocs-ui/components/tabs';
22:42:18.992
105 | import {Callout} from 'fumadocs-ui/components/callout';
22:42:18.992
106 | export const toc = [{
22:42:18.992
22:42:18.992
22:42:18.992
22:42:18.992
Import traces:
22:42:18.992
App Route:
22:42:18.992
./content/docs/references/system/logger/LoggerConfig.mdx.js
22:42:18.992
./apps/docs/.source/server.ts
22:42:18.992
./apps/docs/app/source.ts
22:42:18.992
./apps/docs/app/api/search/route.ts
22:42:18.992
22:42:18.992
Server Component:
22:42:18.992
./content/docs/references/system/logger/LoggerConfig.mdx.js
22:42:18.992
./apps/docs/.source/server.ts
22:42:18.992
./apps/docs/app/source.ts
22:42:18.992
./apps/docs/app/[lang]/blog/[[...slug]]/page.tsx
22:42:18.992
22:42:18.992
https://nextjs.org/docs/messages/module-not-found
22:42:18.992
22:42:18.992
22:42:18.992
./content/docs/references/system/manifest/Manifest.mdx.js:190:1
22:42:18.992
Module not found: Can't resolve 'fumadocs-ui/components/card'
22:42:18.992
188 | }]
22:42:18.992
189 | };
22:42:18.992
190 | import {Card, Cards} from 'fumadocs-ui/components/card';


✨ 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
Copy Markdown

vercel bot commented Jan 27, 2026

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 27, 2026 3:15pm

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@hotlong
Copy link
Copy Markdown
Contributor

hotlong commented Jan 27, 2026

@copilot 23:07:49.096
70 | import {Card, Cards} from 'fumadocs-ui/components/card';
23:07:49.096
71 | import {Tab, Tabs} from 'fumadocs-ui/components/tabs';
23:07:49.096

72 | import {Callout} from 'fumadocs-ui/components/callout';
23:07:49.096
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:07:49.096
73 | export const toc = [{
23:07:49.096
74 | depth: 2,
23:07:49.096
75 | url: "#properties",
23:07:49.096
23:07:49.096
23:07:49.096
23:07:49.096
Import traces:
23:07:49.096
App Route:
23:07:49.096
./content/docs/references/api/discovery/ApiCapabilities.mdx.js
23:07:49.096
./apps/docs/.source/server.ts
23:07:49.096
./apps/docs/app/source.ts
23:07:49.096
./apps/docs/app/api/search/route.ts
23:07:49.096
23:07:49.096
Server Component:
23:07:49.096
./content/docs/references/api/discovery/ApiCapabilities.mdx.js
23:07:49.096
./apps/docs/.source/server.ts
23:07:49.096
./apps/docs/app/source.ts
23:07:49.096
./apps/docs/app/[lang]/blog/[[...slug]]/page.tsx
23:07:49.096
23:07:49.096
https://nextjs.org/docs/messages/module-not-found
23:07:49.096
23:07:49.096
23:07:49.096
./content/docs/references/api/discovery/ApiRoutes.mdx.js:108:1
23:07:49.096
Module not found: Can't resolve 'fumadocs-ui/components/callout'
23:07:49.096
106 | import {Card, Cards} from 'fumadocs-ui/components/card';
23:07:49.096
107 | import {Tab, Tabs} from 'fumadocs-ui/components/tabs';
23:07:49.096
108 | import {Callout} from 'fumadocs-ui/components/callout';
23:07:49.096
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@hotlong hotlong marked this pull request as ready for review January 27, 2026 15:17
Copilot AI review requested due to automatic review settings January 27, 2026 15:18
@hotlong hotlong merged commit 7a5ffc2 into copilot/improve-zod-protocol-display Jan 27, 2026
2 checks passed
Copilot AI requested a review from hotlong January 27, 2026 15:18
Copilot stopped work on behalf of hotlong due to an error January 27, 2026 15:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses module resolution errors in the Next.js documentation site by removing unnecessary fumadocs-ui component imports from MDX files and centralizing component registration in the page rendering configuration.

Changes:

  • Removed redundant fumadocs-ui component imports from 449 MDX files
  • Added Tab and Tabs components to the centralized MDX components object
  • Updated webpack configuration to resolve fumadocs-ui component paths
  • Removed experimental Turbopack configuration
  • Simplified build script by removing NEXT_PRIVATE_BUILD_WORKER flag

Reviewed changes

Copilot reviewed 300 out of 452 changed files in this pull request and generated 2 comments.

File Description
content/docs/references/**/*.mdx (449 files) Removed redundant fumadocs-ui component imports that were causing module resolution errors
apps/docs/app/[lang]/docs/[[...slug]]/page.tsx Added Tab and Tabs to centralized components object for MDX rendering
apps/docs/next.config.mjs Updated webpack aliases to resolve fumadocs-ui components and lucide-react, removed experimental turbo configuration
apps/docs/package.json Removed NEXT_PRIVATE_BUILD_WORKER environment variable from build script

Comment on lines +27 to +30
'fumadocs-ui/components/callout$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/callout.js'),
'fumadocs-ui/components/card$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/card.js'),
'fumadocs-ui/components/tabs$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/tabs.js'),
'lucide-react$': path.resolve(__dirname, './node_modules/lucide-react/dist/cjs/lucide-react.js'),
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The webpack aliases use relative paths starting with ./node_modules/ which assumes a specific directory structure. This could break if the project uses workspaces or pnpm where node_modules might be hoisted. Consider using require.resolve() for more reliable module resolution across different package manager configurations.

Copilot uses AI. Check for mistakes.
'fumadocs-ui/components/callout$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/callout.js'),
'fumadocs-ui/components/card$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/card.js'),
'fumadocs-ui/components/tabs$': path.resolve(__dirname, './node_modules/fumadocs-ui/dist/components/tabs.js'),
'lucide-react$': path.resolve(__dirname, './node_modules/lucide-react/dist/cjs/lucide-react.js'),
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lucide-react alias points to the CJS (CommonJS) build, but Next.js prefers ESM modules for better tree-shaking and performance. Consider using the ESM build path instead: lucide-react/dist/esm/lucide-react.js.

Suggested change
'lucide-react$': path.resolve(__dirname, './node_modules/lucide-react/dist/cjs/lucide-react.js'),
'lucide-react$': path.resolve(__dirname, './node_modules/lucide-react/dist/esm/lucide-react.js'),

Copilot uses AI. Check for mistakes.
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.

3 participants