Skip to content

Commit 0dfe89b

Browse files
committed
Merge branch 'dev' of https://github.com/fuma-nama/fumadocs into dev
2 parents 39a5314 + 222d144 commit 0dfe89b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/mdx/src/utils/validation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export class ValidationError extends Error {
1515
}
1616

1717
async toStringFormatted() {
18-
const picocolors = await import('picocolors');
18+
// Handle ESM/CJS interop: picocolors is a CJS module that exports via
19+
// module.exports = createColors(). When dynamically imported in ESM context
20+
// (e.g., Next.js 16 Turbopack), the exports are wrapped under .default
21+
const picocolorsModule = await import('picocolors');
22+
const picocolors = picocolorsModule.default ?? picocolorsModule;
1923

2024
return [
2125
picocolors.bold(`[MDX] ${this.title}:`),

0 commit comments

Comments
 (0)