Skip to content

Commit

Permalink
chore(build/ssr): add warning if document has no url
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Jun 14, 2024
1 parent 8b9265d commit e1ea7cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ async function findDocuments(noDocs: boolean) {
async function ssrSingleDocument(file: string): Promise<string> {
const context: HydrationData = JSON.parse(await readFile(file, "utf-8"));
if (!context?.url) {
console.warn(
`WARNING: Skipped rendering HTML. Document is missing url: ${file}`
);
return null;
}
const html = renderHTML(context);
Expand Down

0 comments on commit e1ea7cc

Please sign in to comment.