typeorm-cursor-pagination icon indicating copy to clipboard operation
typeorm-cursor-pagination copied to clipboard

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

Open 1valdis opened this issue 1 year ago • 2 comments

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 avatar Nov 03 '23 09:11 1valdis

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.

1valdis avatar Nov 03 '23 09:11 1valdis

i am also facing this problem

LightDev1 avatar Nov 03 '23 13:11 LightDev1