in @types/node, the typescript signature of Writable._write(...) function changed from
_write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
to
_write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
This is not compatible with kafka-node definition of ProducerStream
../../node_modules/kafka-node/types/index.d.ts:143:3 - error TS2416: Property '_write' in type 'ProducerStream' is not assignable to the same property in base type 'Writable'.
Type '(message: ProduceRequest, encoding: "utf8" | "buffer", cb: (error: any, data: any) => any) => void' is not assignable to type '(chunk: any, encoding: BufferEncoding, callback: (error?: Error) => void) => void'.
Types of parameters 'encoding' and 'encoding' are incompatible.
Type 'BufferEncoding' is not assignable to type '"utf8" | "buffer"'.
Type '"ascii"' is not assignable to type '"utf8" | "buffer"'.
143 _write (message: ProduceRequest, encoding: 'buffer' | 'utf8', cb: (error: any, data: any) => any): void;
~~~~~~
I have the same problem after upgrading to .kafka-node^5.0.0
Add "skipLibCheck": true to tsconfig.json works for me.
Most helpful comment
I have the same problem
after upgrading to.kafka-node^5.0.0Update:
Add
"skipLibCheck": truetotsconfig.jsonworks for me.