loopbackio / loopbackio/loopback-next
Can't override app.start if RepositoryMixin used: TS2425
@achrinza is already working on this.
Since Nov 19, 2021.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
Steps to reproduce
- Create an app that uses
RepositoryMixin - Try to override the application
startmethod
Current Behavior
error TS2425: Class '... & RestApplication' defines instance member property 'start', but extended class 'Application' defines it as instance member function.
Expected Behavior
It should compile!
It used to compile just fine in older releases.
Link to reproduction sandbox
- clone https://github.com/mgabeler-lee-6rs/lb4-bugs
- run
npm run build
Additional information
Playing around with the mixins:
BootMixin(RestApplication)-- OKBootMixinre-declares thestartmember
BootMixin(RepositoryMixin(RestApplication))-- failsRepositoryMixin(BootMixin(RestApplication))-- fails
Looking through the history of repository.mixin.ts, the only thing I see that I could point to as a probable cause for this is https://github.com/loopbackio/loopback-next/pull/5394/files#diff-11574932d711bedee7d0693e1b5f50ebfd143a78cc62e36bb31ea5e0e711140c
Overriding application.start is "documented as OK" if you will, insofar as the hello-world example uses it almost exactly the way my repro does, the difference being that hello-world doesn't have the repos mixin: https://github.com/loopbackio/loopback-next/blob/master/examples/hello-world/src/application.ts#L23
Related Issues
Nothing found yet
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.