margau / dmxnet

ArtNet-DMX-sender and receiver for nodejs
MIT License
69 stars 22 forks source link

Issue with hibas123? #24

Closed Xeonzinc closed 3 years ago

Xeonzinc commented 4 years ago

Hi, I've just tried a simple test of the code but seem to get an error from the hibas dependency. Am I doing something wrong with initialising it or is there an issue upstream? I have tried some of the logging options mentioned elsewhere on here with no luck.

Code:

var dmxlib=require('dmxnet');

var dmxnet = new dmxlib.dmxnet({
  verbose: 1, //Verbosity, default 0
  oem: 0, //OEM Code from artisticlicense, default to dmxnet OEM.
  sName: "Eminant DMX", // 17 char long node description, default to "dmxnet"
  lName: "A really good DMX controller function", // 63 char long node description, default to "dmxnet - OpenSource ArtNet Transceiver"
    log: {
    files: false,
    name: "dmxnet"
  }});

var sender=dmxnet.newSender({
  ip: "192.168.0.201", //IP to send to, default 255.255.255.255
  subnet: 0, //Destination subnet, default 0
  universe: 0, //Destination universe, default 0
  net: 0, //Destination net, default 0
  port: 6454, //Destination UDP Port, default 6454
  base_refresh_interval: 1000 // Default interval for sending unchanged ArtDmx
});

sender.fillChannels(1,4,255);
sender.fillChannels(5,7,0);

Error:


C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\node_modules\@hibas123\utils\lib\observable.js:68
        Array.from(this.subscriber.values()).forEach(e => {
                                   ^

TypeError: this.subscriber.values is not a function
    at Observable.send (C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\node_modules\@hibas123\utils\lib\observable.js:68:36)
    at LoggingBase.message (C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\node_modules\@hibas123\logging\out\base.js:257:32)
    at LoggingBase.log (C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\node_modules\@hibas123\logging\out\base.js:96:18)
    at new dmxnet (C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\node_modules\dmxnet\lib.js:45:9)
    at Object.<anonymous> (C:\Users\emina\OneDrive\Escape Room\Subsystems\Host\node_server\dmx_test.js:3:14)
hibas123 commented 4 years ago

Hi, I'm the maintainer of the library which causes the issue.

Cloud you please tell me the NodeJS Version, as well as the version of @hibas123/utils (from your package-lock.json) you are using?

hibas123 commented 4 years ago

OK, so I was able to recreate the bug using NodeJS 8 or lower. NodeJS 8 is well out of support so I would consider switching to a more recent version.

Xeonzinc commented 4 years ago

Hi, Thanks for the quick response, my node version is 10.6.0, and under npm list I get this for hibas:

+-- dmxnet@0.4.1 | +-- @hibas123/nodelogging@2.2.2 | | +-- @hibas123/logging@2.2.2 | | | -- @hibas123/utils@2.2.3 deduped | |-- @hibas123/utils@2.2.3

hibas123 commented 4 years ago

OK, in NodeJS v10.6.0 I can reproduce the error as well. With the latest v10 release 10.20.1 this is working properly. I think the easiest way to solve the issue would be updating to the latest v10 or v12 release.

Xeonzinc commented 4 years ago

Thanks that has resolved it

margau commented 4 years ago

Would Like to reopen it and document this issue/abort when node is to old.