djipco / hpgl

A Node.js library to communicate with HPGL-compatible plotters and printers.
MIT License
38 stars 4 forks source link

isOpen is not a function in SerialPort v5, but a property #3

Closed juliendorra closed 6 years ago

juliendorra commented 6 years ago

Bug : when using node HPGL with the last version of node SerialPort, I got this error:

return (this.transport && this.transport.isOpen()) === true;
TypeError: this.transport.isOpen is not a function

Apparently "isOpen is now a property", starting from version 5. https://github.com/node-serialport/node-serialport/blob/master/UPGRADE_GUIDE.md

Turning the function call into a property check on line 856 and 963 of hpgl.js fix the issue.

djipco commented 6 years ago

This has been fixed in version 0.8.7-5. This new version has been pushed to npm.