I am running into an issue trying to create a simple test with your package.
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/jordan/git/generic/project/prototypes/full-stack/electron/utils/artico-test/node_modules/nanoid/index.js from /home/jordan/git/generic/project/prototypes/full-stack/electron/utils/artico-test/node_modules/@rtco/client/build/index.js not supported.
Instead change the require of /home/jordan/git/generic/project/prototypes/full-stack/electron/utils/artico-test/node_modules/nanoid/index.js in /home/jordan/git/generic/project/prototypes/full-stack/electron/utils/artico-test/node_modules/@rtco/client/build/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/jordan/git/generic/project/prototypes/full-stack/electron/utils/artico-test/node_modules/@rtco/client/build/index.js:1:2065) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v20.11.1
import { Artico, type Call } from "@rtco/client";
;
const rtco = new Artico();
rtco.on("open", (id: string) => {
// We're now connected to the signaling server.
// `id` refers to the unique ID that is currently assigned to this peer, so remote peers can connect to us.
console.log("Connected to signaling server with peer ID:", id);
});
rtco.on("close", () => {
console.log("Connection to signaling server is now closed.");
});
rtco.on("error", (err) => {
console.log("Artico error:", err);
});
rtco.on("call", (call: Call) => {
// The calling peer can link any metadata object to a call.
const { metadata } = call;
const remotePeerName = JSON.parse(metadata!).name;
console.log(`Call from ${remotePeerName}...`);
// Answer the call.
call.answer();
call.on("stream", (stream, metadata) => {
// Stream was added by remote peer, so display it somehow.
// `metadata` can be appended by the remote peer when adding the stream.
});
});```
I am running into an issue trying to create a simple test with your package.
Here is my package.json
and my tsconfig.json
Here is my index.ts