Comments (11)
One more workaround
//Explanation: https://github.com/ukyo/lz4.js/issues/14
const originalFetch = global.fetch;
global.fetch = undefined;
const LZ4 = require('kafkajs-lz4');
global.fetch = originalFetch;
CompressionCodecs[CompressionTypes.LZ4] = new LZ4().codec;
from kafkajs-lz4.
You can try to write your own wrapper around other lz4 library or switch to snappy as we did
from kafkajs-lz4.
Hi, this workaround doesn't work for me and I still get the same error, I think it's because I use esbuild
, all the require()
are called first!
I don't know if the authors still work on this project (last commit was +2 years ago), but yeah the lib is broken for Nodejs18
from kafkajs-lz4.
Oh hi @mark-b-ab, thanks! I don't like workarounds and I was not going back to NodeJSv16 because an old lib will probably never get updated, so I have switched to Snappy too even if I have hesitated with the ZSTD!
NB: Despite having compression.type=producer
by default at broker-side, I haven't noticed any compression optimization by Snappy with the kafkajs
client though (the last commit on the Snappy lib is +4y)
from kafkajs-lz4.
bump
from kafkajs-lz4.
Hi all, I am getting the same error for all node versions of 18 or higher. Also, I cannot able to use snappy. Is there any other alternative for this?
from kafkajs-lz4.
Hi all, I am getting the same error for all node versions of 18 or higher. Also, I cannot able to use snappy. Is there any other alternative for this?
Use workarounds. Works fine, running in prod, all good
from kafkajs-lz4.
Hi @Marko298 , thanks for the quick reply. Could you specify the workarounds?
from kafkajs-lz4.
Hi @Marko298 , thanks for the quick reply. Could you specify the workarounds?
from kafkajs-lz4.
That didn't work @Marko298
from kafkajs-lz4.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafkajs-lz4.