diff --git a/apps/www/lib/rehype-component.ts b/apps/www/lib/rehype-component.ts index 40451f56cb..17dd2a0b16 100644 --- a/apps/www/lib/rehype-component.ts +++ b/apps/www/lib/rehype-component.ts @@ -106,10 +106,10 @@ export function rehypeComponent() { try { for (const style of styles) { const component = Index[style.name][name] - const src = component.files[0] + const src = component.files[0]?.path // Read the source file. - const filePath = path.join(process.cwd(), src) + const filePath = src let source = fs.readFileSync(filePath, "utf8") // Replace imports.