Describe the bug
I'm trying to use the example provided in the readme
import { Web } from "./sip.js";
// Helper function to get an HTML audio element
function getAudioElement(id: string): HTMLAudioElement {
const el = document.getElementById(id);
if (!(el instanceof HTMLAudioElement)) {
throw new Error(`Element "${id}" not found or not an audio element.`);
}
return el;
}
// Options for SimpleUser
const options: Web.SimpleUserOptions = {
aor: "sip:alice@example.com", // caller
media: {
constraints: { audio: true, video: false }, // audio only call
remote: { audio: getAudioElement("remoteAudio") } // play remote audio
}
};
// WebSocket server to connect with
const server = "wss://sip.example.com";
// Construct a SimpleUser instance
const simpleUser = new Web.SimpleUser(server, options);
// Connect to server and place call
simpleUser.connect()
.then(() => simpleUser.call("sip:bob@example.com"))
.catch((error: Error) => {
// Call failed
});
Observed behavior
I get a error in the Firefox console
Uncaught SyntaxError: ambiguous indirect export: Web
and in Chrome
caught SyntaxError: The requested module './sip.js' does not provide an export named 'Web' (at test.js:1:10)
Describe the bug I'm trying to use the example provided in the readme
Observed behavior I get a error in the Firefox console
and in Chrome
Environment Information
I'm doing something wrong or there's a bug?