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 ;
@@ -101,6 +101,11 @@ export class CommonEngine {
101101 }
102102
103103 const moduleOrFactory = this . module || opts . bootstrap ;
104+
105+ if ( ! moduleOrFactory ) {
106+ throw new Error ( 'A module or bootstrap option must be provided.' ) ;
107+ }
108+
104109 const html = await renderModule ( moduleOrFactory , { extraProviders } ) ;
105110 if ( ! inlineCriticalCss ) {
106111 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