micropython-ctl
micropython-ctl copied to clipboard
Uncaught (in promise) Error: Illegal constructor
I'm trying to use this library in a electron app, but when I try to connect over the serial port, I get the following error: Uncaught (in promise) Error: Illegal constructor.
The code I'm calling is:
contextBridge.exposeInMainWorld(
'micropython',
{
sendCode: async (device, code) => {
const dev = new MicroPythonDevice();
await dev.connectSerial(device);
await dev.putFile('main.py', Buffer.from(code, "utf-8"));
await dev.runScript(code);
await dev.disconnect();
}
}
)
It appears to be coming from this line