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';
15
15
16
16
/** These are the allowed options for the render */
17
17
export interface RenderOptions {
18
- bootstrap : Type < { } > ;
18
+ bootstrap ? : Type < { } > ;
19
19
providers ?: StaticProvider [ ] ;
20
20
url ?: string ;
21
21
document ?: string ;
@@ -101,6 +101,11 @@ export class CommonEngine {
101
101
}
102
102
103
103
const moduleOrFactory = this . module || opts . bootstrap ;
104
+
105
+ if ( ! moduleOrFactory ) {
106
+ throw new Error ( 'A module or bootstrap option must be provided.' ) ;
107
+ }
108
+
104
109
const html = await renderModule ( moduleOrFactory , { extraProviders } ) ;
105
110
if ( ! inlineCriticalCss ) {
106
111
return html ;
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ import type { Request, Response } from 'express';
14
14
/**
15
15
* These are the allowed options for the engine
16
16
*/
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
+ }
21
21
22
22
/**
23
23
* These are the allowed options for the render
You can’t perform that action at this time.
0 commit comments