benjamin658 / typeorm-cursor-pagination

Cursor-based pagination works with TypeORM Query Builder.
MIT License
186 stars 40 forks source link

Type 'Entity' does not satisfy the constraint 'ObjectLiteral' #80

Open 1valdis opened 1 year ago

1valdis commented 1 year ago

Running this package with Typescript 4.9 and above results in the following error:

node_modules/typeorm-cursor-pagination/lib/Paginator.d.ts:34:42 - error TS2344: Type 'Entity' does not satisfy the constraint 'ObjectLiteral'.

34     paginate(builder: SelectQueryBuilder<Entity>): Promise<PagingResult<Entity>>;
                                            ~~~~~~

  node_modules/typeorm-cursor-pagination/lib/Paginator.d.ts:18:32
    18 export default class Paginator<Entity> {
                                      ~~~~~~
    This type parameter might need an `extends ObjectLiteral` constraint.

Found 1 error(s).
1valdis commented 1 year ago

I see the code in src is correct in the repo, but somehow remains old on npm. @benjamin658 please rebuild and release the package to have the correct code on npm too.

LightDev1 commented 1 year ago

i am also facing this problem