We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 39a5314 + 222d144 commit 0dfe89bCopy full SHA for 0dfe89b
packages/mdx/src/utils/validation.ts
@@ -15,7 +15,11 @@ export class ValidationError extends Error {
15
}
16
17
async toStringFormatted() {
18
- const picocolors = await import('picocolors');
+ // 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;
23
24
return [
25
picocolors.bold(`[MDX] ${this.title}:`),
0 commit comments