This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { URL } from 'url';
1515
1616/** These are the allowed options for the render */
1717export interface RenderOptions {
18- bootstrap : Type < { } > ;
18+ bootstrap ? : Type < { } > ;
1919 providers ?: StaticProvider [ ] ;
2020 url ?: string ;
2121 document ?: string ;
@@ -105,6 +105,11 @@ export class CommonEngine {
105105 }
106106
107107 const moduleOrFactory = this . module || opts . bootstrap ;
108+
109+ if ( ! moduleOrFactory ) {
110+ throw new Error ( 'A module or bootstrap option must be provided.' ) ;
111+ }
112+
108113 const html = await renderModule ( moduleOrFactory , { extraProviders } ) ;
109114 if ( ! inlineCriticalCss ) {
110115 return html ;
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ import type { Request, Response } from 'express';
1414/**
1515 * These are the allowed options for the engine
1616 */
17- export type NgSetupOptions = Pick <
18- CommonRenderOptions ,
19- ' bootstrap' | 'providers' | 'publicPath' | 'inlineCriticalCss'
20- > ;
17+ export interface NgSetupOptions
18+ extends Pick < CommonRenderOptions , 'providers' | 'publicPath' | 'inlineCriticalCss' > {
19+ bootstrap : NonNullable < CommonRenderOptions [ 'bootstrap' ] > ;
20+ }
2121
2222/**
2323 * These are the allowed options for the render
You can’t perform that action at this time.
0 commit comments