fix: throw error when no partials found (#1853)

This commit is contained in:
Marvin Hagemeister
2023-10-04 15:38:43 +02:00
committed by GitHub
parent ea91687ea3
commit be1c15f8f3
7 changed files with 83 additions and 3 deletions
+6
View File
@@ -687,6 +687,12 @@ export async function applyPartials(res: Response): Promise<void> {
sib = sib.nextSibling;
}
if (encounteredPartials.length === 0) {
throw new Error(
`Found no partials in HTML response. Please make sure to render at least one partial. Requested url: ${res.url}`,
);
}
// Update all encountered partials
for (let i = 0; i < encounteredPartials.length; i++) {
const { vnode, marker } = encounteredPartials[i];