From 9dcbb3d9f93032e6fff21ac69916605d7c72c9b2 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Thu, 7 May 2026 15:24:14 +0300 Subject: [PATCH] Fixed startup of js-executor for lz4 compression --- msa/js-executor/queue/kafkaTemplate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/msa/js-executor/queue/kafkaTemplate.ts b/msa/js-executor/queue/kafkaTemplate.ts index 1114190e64..175abd80f4 100644 --- a/msa/js-executor/queue/kafkaTemplate.ts +++ b/msa/js-executor/queue/kafkaTemplate.ts @@ -56,7 +56,10 @@ export class KafkaTemplate implements IQueue { case 'lz4': { // Load the LZ4 codec lazily so users who don't enable LZ4 don't take a hard // dependency on the lz4-napi native binary (e.g. inside pkg-built executables). - const LZ4Codec = require('@2l/kafkajs-lz4').default; + // The package re-assigns module.exports = LZ4Codec, which wipes the __esModule + // flag and the .default property — so accept either shape. + const lz4Module = require('@2l/kafkajs-lz4'); + const LZ4Codec = lz4Module.default || lz4Module; CompressionCodecs[CompressionTypes.LZ4] = new LZ4Codec().codec; return CompressionTypes.LZ4; }