coapjs / node-coap

CoAP - Node.js style
MIT License
528 stars 154 forks source link

Crash with node 10 #364

Closed ankit2002 closed 1 year ago

ankit2002 commented 1 year ago

Hi

With tag 1.3.3, did you observe the following error on node 10 ReferenceError: globalThis is not defined

I believe this will only work with node version above 10 and brake systems with older node versions.

Thanks

Apollon77 commented 1 year ago

Hello, can you please provide a full stack trace?

In fact nodejs 10 is EOL since minimum 2 years, so yes lastly it worked, but because of all incompatibilities we can not make sure it stays that way because we can not test with nodejs 10 anymore.

As stated in the readme:

The library should run on Node versions 10 and above but is only tested with LTS versions (currently 12, 14, and 16).

ankit2002 commented 1 year ago

Hi, Will this help. Thanks

Node version node -v v10.19.0

node_modules/coap/node_modules/readable-stream/lib/ours/util.js:5 const Blob = globalThis.Blob || bufferModule.Blob ^

ReferenceError: globalThis is not defined at Object. ( node_modules/coap/node_modules/readable-stream/lib/ours/util.js:5:14) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. ( node_modules/coap/node_modules/readable-stream/lib/stream.js:31:5) at Module._compile (internal/modules/cjs/loader.js:778:30)

Apollon77 commented 1 year ago

Ok, then an upgrade from readable-stream kilkled nodejs 10 support for us too ... we will update the package.json requirements. Sorry, starting at nodejs 12 (which is btw also EOL already since nearly 1 year! - and this year nodejs 14 AND 16 will go EOL till september!! SO nodjes 18 is the way to go!)