Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafkajs is not compatible with Nodev18 #1662

Open
saifahmedkhan9 opened this issue Jan 31, 2024 · 5 comments
Open

kafkajs is not compatible with Nodev18 #1662

saifahmedkhan9 opened this issue Jan 31, 2024 · 5 comments

Comments

@saifahmedkhan9
Copy link

Using

  • Kafkajs version : 2.2.3
  • Kafkajs-lz4 version : 2.0.0-beta.0

On upgrading nodejs version from 16 to 18. kafkajs lz4 library is throwing below errors :

TypeError: Failed to parse URL from /home/user/appName/node_modules/lz4-asm/dist/_lz4.wasm
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:405:5)
      at new URL (node:internal/url:676:13)
      at new Request (node:internal/deps/undici/undici:5270:25)
      at fetch (node:internal/deps/undici/undici:9508:25)
      at Object.fetch (node:internal/deps/undici/undici:11728:18)
      at fetch (node:internal/process/pre_execution:281:25)
      at /home/user/appName/node_modules/lz4-asm/dist/lz4wasm.js:21:123
      at /home/user/appName/node_modules/lz4-asm/dist/lz4wasm.js:21:344
      at /home/user/appName/node_modules/lz4-asm/dist/lz4wasm.js:21:357
      at Object.<anonymous> (/home/user/appName/node_modules/kafkajs-lz4/lib/index.js:5:18)
      at Module._compile (node:internal/modules/cjs/loader:1356:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
      at Module.load (node:internal/modules/cjs/loader:1197:32)
      at Module._load (node:internal/modules/cjs/loader:1013:12)
      at Module.require (node:internal/modules/cjs/loader:1225:19)
      at require (node:internal/modules/helpers:177:18) {
    input: '/home/user/appName/node_modules/lz4-asm/dist/_lz4.wasm',
    code: 'ERR_INVALID_URL'
  }
}
 
/home/user/appName/node_modules/lz4-asm/dist/lz4wasm.js:12
if(r)t=q?require("path").dirname(t)+"/":__dirname+"/",u=function(a,b){w||(w=require("fs"));x||(x=require("path"));a=x.normalize(a);return w.readFileSync(a,b?null:"utf8")},v=function(a){a=u(a,!0);a.buffer||(a=new Uint8Array(a));a.buffer||y("Assertion failed: undefined");return a},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(a){if(!(a instanceof z))throw a;}),process.on("unhandledRejection",y),n=function(a){process.exit(a)},
                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
 
RuntimeError: abort(TypeError: Failed to parse URL from /home/user/appName/node_modules/lz4-asm/dist/_lz4.wasm). Build with -s ASSERTIONS=1 for more info.
    at process.y (/home/user/appName/node_modules/lz4-asm/dist/lz4wasm.js:16:393)
    at process.emit (node:events:517:28)
    at emit (node:internal/process/promises:149:20)
    at processPromiseRejections (node:internal/process/promises:283:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
 
Node.js v18.19.0
@vkbera
Copy link

vkbera commented Feb 24, 2024

any update on this issue??

@joras
Copy link

joras commented Mar 13, 2024

i guess the underlying issue is ukyo/lz4.js#14

@joras
Copy link

joras commented Mar 14, 2024

the whole thing should be quite easy to fix, i guess the whole chain down to lz4 is not maintained :)

@ptrpiero
Copy link

ptrpiero commented Apr 17, 2024

The issue is not present with version of Kafkajs-lz4 lower than 2.0.0-beta.0 (tested with 1.2.1 and it works)

@aman-goyal-git
Copy link

any fix for this issue ? I am also seeing the same error when using kafkajs with Node v18. It works fine with Node v16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants