Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Error TS2350 when create a new Promise in certain situations #1591

@QuinntyneBrown

Description

@QuinntyneBrown

Using the .NET Core 2.1 Template when creating a new Promise in certain situation, you get a TS2350 error.

It looks like there is another Promise type definition that Visual Studio is getting confused with, Q.IPromise.

The following code inside a HubClient Service will raise an error as the compiler thinks I'm trying to use Q.IPromise and not the native promise.

public connect(): Promise {
if (this._connect) return this._connect;

this._connect = new Promise((resolve) => {
  this._connection = this._connection || new HubConnection("/signalrDemoHub");
  this._connection.start().then(() => resolve());
});

return this._connect;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions