diff --git a/src/routes/streams/[stream_id]/StreamPage.svelte b/src/routes/streams/[stream_id]/StreamPage.svelte index dd7d826..387c958 100644 --- a/src/routes/streams/[stream_id]/StreamPage.svelte +++ b/src/routes/streams/[stream_id]/StreamPage.svelte @@ -2,12 +2,15 @@ import { getStreamContext } from '$lib/streamContext.svelte.ts'; import { shorthandCode, formatTrackTime, formatDate } from '$lib/utils.ts'; import { jumpToTrack } from './Player.svelte'; + import { browser } from '$app/environment'; import { Carta } from 'carta-md'; - import DOMPurify from 'isomorphic-dompurify'; - const carta = new Carta({ - sanitizer: DOMPurify.sanitize - }); + let carta = $state(new Carta()); + if (browser) { + import('isomorphic-dompurify').then(({ default: DOMPurify }) => { + carta = new Carta({ sanitizer: DOMPurify.sanitize }); + }); + } const ctx = getStreamContext();