Skip to content

New "stop" alias don't allow stuff to work #1837

Description

@danysz

Steps to reproduce

lb4 app
lb4 model
lb4 datasource (choose pg)
lb4 repository
npm start

Current Behavior

src/datasources/main.datasource.ts:33:3 - error TS2416: Property 'stop' in type 'MainDataSource' is not assignable to the same property in base type 'DataSource'.
Type '() => ValueOrPromise' is not assignable to type '() => Promise'.
Type 'ValueOrPromise' is not assignable to type 'Promise'.
Type 'void' is not assignable to type 'Promise'.

33 stop(): ValueOrPromise {
~~~~

src/repositories/test-model.repository.ts:14:22 - error TS2345: Argument of type 'MainDataSource' is not assignable to parameter of type 'DataSource'.
Types of property 'stop' are incompatible.
Type '() => ValueOrPromise' is not assignable to type '() => Promise'.

14 super(TestModel, dataSource);
~~~~~~~~~~

Expected Behavior

to work

Link to reproduction sandbox

https://github.com/danysz/test-connection-app-lb4-pg

Additional information

darwin x64 12.16.1

├── @loopback/boot@2.1.1
├── @loopback/context@3.5.1
├── @loopback/core@2.4.1
├── @loopback/openapi-v3@3.2.1
├── @loopback/repository@2.2.1
├── @loopback/rest@3.3.1
├── @loopback/rest-explorer@2.1.1
├── @loopback/service-proxy@2.1.1
├── loopback-connector-postgresql@3.9.1

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions