#Simple <Code /> usage is giving errors

4 messages · Page 1 of 1 (latest)

maiden blade
#

Using it in an .mdx file is straightforward and produces no issues:

import { Code } from "astro:components";

<Code lang="csharp" code={`
if (AppDomain.CurrentDomain.FriendlyName == "AppDomain 2")
    return; // Don't continue loading the appdomain
`} />

However if I try to use it in a .svelte file, it gives errors like this:

<script lang="ts">
    import { Code } from "astro:components";
</script>

<Code lang="csharp" code={`
if (AppDomain.CurrentDomain.FriendlyName == "AppDomain 2")
    return; // Don't continue loading the appdomain
`} />
[astro-island] Error hydrating /src/content/blog/binding-redirects/note3.svelte SyntaxError: The requested module 'http://localhost:4321/node_modules/prismjs/prism.js?v=029a2bf6' doesn't provide an export named: 'default'
errant creek
maiden blade
#

cool, that works. a bit messy but it's better than nothing
thanks

errant creek
#

No worries 🙂