Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

typescript errors on angular@10 with @nguniversal/express-engine@10 #1744

@amitport

Description

@amitport

following the initial installation instruction in angular.io (ng add):

ERROR in server.ts:18:25 - error TS2345: Argument of type '(filePath: string, options: Readonly<RenderOptions>, callback: (err?: Error | null | undefined, html?: string | undefined) =
> void) => void' is not assignable to parameter of type '(path: string, options: object, callback: (e: any, rendered?: string | undefined) => void) => void'.
  Types of parameters 'options' and 'options' are incompatible.
    Type '{}' is missing the following properties from type 'Readonly<RenderOptions>': req, bootstrap

18   server.engine('html', ngExpressEngine({
                           ~~~~~~~~~~~~~~~~~
19     bootstrap: AppServerModule,
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20   }));
   ~~~~
server.ts:37:3 - error TS2322: Type 'Express' is not assignable to type 'void'.

37   return server;
     ~~~~~~~~~~~~~~
server.ts:45:10 - error TS2339: Property 'listen' does not exist on type 'void'.

45   server.listen(port, () => {

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions