benjamin658 / typeorm-cursor-pagination

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

Typescript build issue when re-exporting types #36

Closed nlaffey-icario closed 2 years ago

nlaffey-icario commented 3 years ago

I'm running into build issues currently due to re-exporting the types without the type keyword.

Invoking: tsc --noEmit 

Error: ../../common/temp/node_modules/.pnpm/typeorm-cursor-pagination@0.6.1_typeorm@0.2.34/node_modules/typeorm-cursor-pagination/src/index.ts(5,10): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Error: ../../common/temp/node_modules/.pnpm/typeorm-cursor-pagination@0.6.1_typeorm@0.2.34/node_modules/typeorm-cursor-pagination/src/index.ts(5,17): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
Error: ../../common/temp/node_modules/.pnpm/typeorm-cursor-pagination@0.6.1_typeorm@0.2.34/node_modules/typeorm-cursor-pagination/src/index.ts(5,25): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

Setting isolatedModules to false in my tsconfig.json gets around this issue for now but I'd rather not do that.

It appears the fix would be to just update line 5 to:

export type { Order, Cursor, PagingResult };
nlaffey-icario commented 3 years ago

I created a PR here: https://github.com/benjamin658/typeorm-cursor-pagination/pull/37

benjamin658 commented 2 years ago

Fixed in bade90039714c24ce306787485f3f407df9bd931