node-modbus-serial icon indicating copy to clipboard operation
node-modbus-serial copied to clipboard

`no-serial-port` actually requires `serialport`

Open IlCallo opened this issue 6 months ago • 11 comments

I'm trying to use latest 8.0.20-no-serial-port version in an ESM project It does indeed require serialport in multiple occasions, making the whole package less portable (I'm bundling a Node app with Bun compilation)

These are the lines that force a dependency on serialport:

https://github.com/yaacov/node-modbus-serial/blob/94c1a3ebc7f3ae275932021ee7bda9917c7327e6/index.js#L21

https://github.com/yaacov/node-modbus-serial/blob/94c1a3ebc7f3ae275932021ee7bda9917c7327e6/index.js#L1240

https://github.com/yaacov/node-modbus-serial/blob/94c1a3ebc7f3ae275932021ee7bda9917c7327e6/index.js#L1256-L1258

https://github.com/yaacov/node-modbus-serial/blob/94c1a3ebc7f3ae275932021ee7bda9917c7327e6/index.js#L1264-L1265

Dunno if something changed recently or the package just isn't optimized to be executed within ESM projects

IlCallo avatar Apr 18 '25 17:04 IlCallo