node-serialport icon indicating copy to clipboard operation
node-serialport copied to clipboard

TypeError: Error.captureStackTrace is not a function

Open MarceloSavian opened this issue 7 years ago • 7 comments

Hi,

I created a React app with the command Creat-React-App, and i have to use the serial port to print a something in a thermal print.

I already got some results, but executing the file with the command node app.js in the CMD.

I want to put this in a inteface, so i have to run the npm start, and by doing this i got the following error. I just import the serial port with const SerialPort = require('serialport');. Don't find anything related here, what i have to do ?

TypeError: Error.captureStackTrace is not a function

}; // run the 'prepareStackTrace' function above

Error.captureStackTrace(dummy); //Error is here

dummy.stack; // cleanup

Error.prepareStackTrace = origPST;

MarceloSavian avatar May 13 '19 15:05 MarceloSavian

This is probably a webpack / electron issue.

reconbot avatar May 13 '19 17:05 reconbot

But do i have to install electron to use this ?

MarceloSavian avatar May 14 '19 12:05 MarceloSavian

Sorry I assumed you were using electron, this doesn’t work in a browser as they don’t yet have serialports. If you’re using node, what version?

reconbot avatar May 14 '19 13:05 reconbot

Is the 10.15.3

MarceloSavian avatar May 14 '19 14:05 MarceloSavian

I changed the import to const SerialPort = require('@serialport/stream');, and now i am receiving a "No Binding set on SerialPort.Binding" as an error. Is this a problem with the node or serialport package version ? Do i have to add any other package ?

MarceloSavian avatar May 14 '19 15:05 MarceloSavian

You have to add a the bindings package. @serialport/bindings

reconbot avatar May 20 '19 22:05 reconbot

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.

stale[bot] avatar Jul 19 '19 23:07 stale[bot]