Skip to content

Uncaught (in promise) Error: Illegal constructor #13

@nailuj29

Description

@nailuj29

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions