diff --git a/src/serialports.ts b/src/serialports.ts index e47edced5..7b191a2ee 100644 --- a/src/serialports.ts +++ b/src/serialports.ts @@ -17,7 +17,6 @@ import { Ports } from '@signalk/server-api' import fs from 'fs' -import { SerialPort } from 'serialport' export const listAllSerialPorts = (): Promise => { return new Promise((resolve, reject) => { @@ -36,8 +35,8 @@ export const listAllSerialPorts = (): Promise => { function listSerialPorts() { try { - // eslint-disable-next-line @typescript-eslint/no-var-requires - return SerialPort.list() + // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports + return require('serialport').SerialPort.list() } catch (_err) { return Promise.resolve([]) }