Skip to content

ReferenceError: RTCPeerConnection? #207

Discussion options

You must be logged in to vote

Well it seems that I found a solution, reading the documentation of Sveltekit there is an Api that allows you to execute code if the (Browser) is true, that is to say for some reason Geckos.io client does not work with the Sveltekit server, so adding the following lines the error is solved:

<script>
	import { browser } from "$app/env";
	import geckos from "@geckos.io/client";

	let channel;

	if (browser) {
		channel = geckos({
			url: "http://localhost:4000",
			port: null,
		});
		channel.onConnect((error) => {});
	}

	const testchanel = () => {
		channel.emit("hello", "hello form Frontend");
	};


</script>

<main>
	<h1>hello chat</h1>
	<button on:click={testchanel}>click</button>
</ma…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vitalspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant