TypeError: Error.captureStackTrace is not a function
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;
This is probably a webpack / electron issue.
But do i have to install electron to use this ?
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?
Is the 10.15.3
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 ?
You have to add a the bindings package. @serialport/bindings
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.