16:04:12 error unhandledRejection: Cannot read properties of undefined (reading 'client')
TypeError: Cannot read properties of undefined (reading 'client')
this is my snippet code:
// typescript
import { Socket, SocketConnectOpts } from 'net'
import Modbus from "jsmodbus";
let modbusSocket = new Socket()
const client = new Modbus.client.TCP(modbusSocket)
When using typescript, I get this error:
this is my snippet code:
package.json:
What I tried: If I use
instead of:
problem is solved.
Also there is no problem with js version.