Open CobyPear opened 1 year ago
Have you tried <svelte:component this={content} />
instead of interpolating {@html content}
on an element?
Hi, @steven-aj. I have tried that but I get the following error which I'm not really sure where to start with:
Error: <svelte:component this={...}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <svelte:component this={...}>.
My blog is using mdsvex to dynamically compile markdown files in a load fn in SvelteKit, then returns them to the client. I have been using
{@html }
for this and it works fine. I recently added a codeblock and I recieved an error after publishing the post:Do I need to install prismjs, and if so should it be listed as a peer dependency? edit: I tried installing prismjs as a prod dependency and it still failed. I will try a CDN import in the script tag to workaround for now. edit2: oh duh that didn't work since the module isn't found in the serverless fn, not the client side.
Thanks!