Skip to content

Commit

Permalink
log error
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Aug 7, 2024
1 parent 6908984 commit 9da2c85
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions packages/astro/src/content/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,26 @@ export async function renderEntry(
}

if (entry.isDeferred) {
// @ts-expect-error virtual module
const { default: contentModules } = await import('astro:content-module-imports');
const module = contentModules.get(entry.filePath);
const resolvedComponent = await module();

return {
Content: resolvedComponent.Content,
rendered: {
metadata: {
headings: resolvedComponent.getHeadings?.() ?? [],
remarkPluginFrontmatter: resolvedComponent.frontmatter ?? {},
try {
// @ts-expect-error virtual module
const { default: contentModules } = await import('astro:content-module-imports');
const module = contentModules.get(entry.filePath);
const resolvedComponent = await module();

return {
Content: resolvedComponent.Content,
rendered: {
metadata: {
headings: resolvedComponent.getHeadings?.() ?? [],
remarkPluginFrontmatter: resolvedComponent.frontmatter ?? {},
},
},
},
};
};
} catch (e) {
// eslint-disable-next-line
console.error(e);
}

}

const html =
Expand Down

0 comments on commit 9da2c85

Please sign in to comment.