micropython-ctl icon indicating copy to clipboard operation
micropython-ctl copied to clipboard

Uncaught (in promise) Error: Illegal constructor

Open nailuj29 opened this issue 4 years ago • 0 comments

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

nailuj29 avatar Oct 26 '21 21:10 nailuj29