Skip to content

TS2322 issues in contactService.ts #30

@jmoerdyk

Description

@jmoerdyk

I was trying to run this sample code today in the Aurelia project, and VS2017 15.8.1 and the command line build are giving issues with the API service in ./ClientApp/app/components/contact/contactServce.ts:

  ERROR in ./ClientApp/app/components/contacts/contactService.ts
  (16,9): error TS2322: Type 'Promise<void | Contact[]>' is not assignable to type 'Promise<Contact[]>'.

fail: Microsoft.AspNetCore.NodeServices[0]

    Type 'void | Contact[]' is not assignable to type 'Contact[]'.

fail: Microsoft.AspNetCore.NodeServices[0]

      Type 'void' is not assignable to type 'Contact[]'.

  ERROR in ./ClientApp/app/components/contacts/contactService.ts
  (23,9): error TS2322: Type 'Promise<void | Contact>' is not assignable to type 'Promise<Contact>'.

fail: Microsoft.AspNetCore.NodeServices[0]

    Type 'void | Contact' is not assignable to type 'Contact'.

fail: Microsoft.AspNetCore.NodeServices[0]

      Type 'void' is not assignable to type 'Contact'.

  ERROR in ./ClientApp/app/components/contacts/contactService.ts
  (30,9): error TS2322: Type 'Promise<void | Contact>' is not assignable to type 'Promise<Contact>'.

And I'm so new to TS that I don't know how to being fixing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions