Skip to content

Commit 1a03ee1

Browse files
devversionjelbourn
authored andcommitted
build: properly fail prerender task (#5235)
* The prerender script that runs on the CI did not exit with a proper error-code when the `renderModuleFactory` failed due to errors like in #5233
1 parent a2a25be commit 1a03ee1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/universal-app/prerender.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ const result = renderModuleFactory(KitchenSinkServerModuleNgFactory, {
1313
document: readFileSync(join(__dirname, 'index.html'), 'utf-8')
1414
});
1515

16-
result.then(html => console.log(html));
16+
result
17+
.then(html => console.log(html))
18+
// If rendering the module factory fails, exit the process with an error code because otherwise
19+
// the CI task will not recognize the failure and will show as "success". The error message
20+
// will be printed automatically by the `renderModuleFactory` method.
21+
.catch(() => process.exit(1));

0 commit comments

Comments
 (0)