odata-v4-server icon indicating copy to clipboard operation
odata-v4-server copied to clipboard

tsc compilation error with @types/node 10.9.4

Open LCHarold opened this issue 6 years ago • 3 comments

A project using odata-v4-server npm package and with @types/node version 10.9.4 will throw an error when compiling TypeScript:

src/lib/processor.ts:383:7 - error TS2415: Class 'ODataStreamWrapper' incorrectly extends base class 'Transform'.
  Property '_flush' is protected in type 'ODataStreamWrapper' but public in type 'Transform'.

383 class ODataStreamWrapper extends Transform {
          ~~~~~~~~~~~~~~~~~~


src/lib/processor.ts:431:14 - error TS2415: Class 'ODataProcessor' incorrectly extends base class 'Transform'.
  Property '_flush' is protected in type 'ODataProcessor' but public in type 'Transform'.

431 export class ODataProcessor extends Transform {
                 ~~~~~~~~~~~~~~

The fix is to change both _flush methods in processor.ts to public instead of protected.

LCHarold avatar Sep 05 '18 16:09 LCHarold

Related error: https://github.com/jaystack/odata-v4-server-pgsql-example/issues/5

node_modules/odata-v4-server/build/lib/processor.d.ts:20:22 - error TS2415: Class 'ODataProcessor' incorrectly extends base class 'Transform'.
  Property '_flush' is protected in type 'ODataProcessor' but public in type 'Transform'.

20 export declare class ODataProcessor extends Transform {
                        ~~~~~~~~~~~~~~

ArturBaybulatov avatar Oct 01 '18 14:10 ArturBaybulatov

I am experiencing this issue as well. Are there plans to merge the existing PR to resolve this bug?

rowlanch avatar Nov 05 '19 18:11 rowlanch

TypeScript can build project if pass option tsc --skipLibCheck

antifree avatar Dec 27 '19 10:12 antifree