zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
88 stars 46 forks source link

Error on modem.close(): Cannot read property 'close' of undefined #107

Closed atomdigital closed 1 year ago

atomdigital commented 2 years ago

When calling the modem.close() function, an error appears: Cannot read property 'close' of undefined.

Apollon77 commented 2 years ago

can you please post full stack trace?

atomdigital commented 2 years ago

TypeError: Cannot read property 'close' of undefined at EventEmitter.modem.close (/Users/georgijandrukov/Documents/meteorApps/serial2/node_modules/serialport-gsm/lib/functions/modem.js:42:16) at /Users/georgijandrukov/Documents/meteorApps/serial2/node_modules/serialport-gsm/lib/functions/modem.js:32:15 at new Promise () at EventEmitter.modem.close (/Users/georgijandrukov/Documents/meteorApps/serial2/node_modules/serialport-gsm/lib/functions/modem.js:31:14) at imports/startup/serial.js:553:21 at /Users/georgijandrukov/.meteor/packages/promise/.0.11.2.f5kjk0.2vlhu++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40 => awaited here: at Function.Promise.await (/Users/georgijandrukov/.meteor/packages/promise/.0.11.2.f5kjk0.2vlhu++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12) at imports/startup/serial.js:553:9 at /Users/georgijandrukov/.meteor/packages/promise/.0.11.2.f5kjk0.2vlhu++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40

atomdigital commented 2 years ago

error found. Caused the closure of the port at the moment when the port was already closed

Apollon77 commented 2 years ago

But the library shuld still catch that :-)