You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That currently shows the following problem: Type '() => void' is not assignable to type '() => Bluebird<void>'. Type 'void' is not assignable to type 'Bluebird<void>'.
The problem is in Moleculer's index.d.ts that requires returning a Bluebird promise
Nice find ! 👏👏 I didn't find that solution when porting the template, thats why they are commented out :D
I also think that a change to the definition would not break anything.
I think I found a solution to the
started()
andstopped()
methods:moleculer-template-project-typescript/template/services/greeter.service.ts
Lines 72 to 81 in ba8d5b8
That currently shows the following problem:
Type '() => void' is not assignable to type '() => Bluebird<void>'. Type 'void' is not assignable to type 'Bluebird<void>'.
The problem is in Moleculer's
index.d.ts
that requires returning a Bluebird promiseBecause of this the only way to declare the
started
andstopped
isHowever, it should be possible to use native promises and async/await. To make it work
index.d.ts
must be updated as follows:With
PromiseLike
the compiler will accept anything that looks like a promise.@faeron @icebob I think this change won't break anything but I'm not sure because I'm a complete newbie in Typescript
The text was updated successfully, but these errors were encountered: