#Svelte Context API Hydration Error

5 messages · Page 1 of 1 (latest)

scarlet yew
#

I'm testing how Astro handles Svelte UI Frameworks such as shadcn-svelte. But when the component use Context API, shows these errors:

~$ [astro-island] Error hydrating /src/lib/components/ui/avatar/index.ts TypeError: Cannot destructure property 'elements' of 'getCtx3(...)' as it is undefined.
~$ [astro-island] Error hydrating /src/lib/components/ui/avatar/index.ts TypeError: Cannot read properties of undefined (reading 'options')

Does anyone have an idea what it could be?

narrow knoll
#

Hi, could you provide a minimal reproduction or some code snippets?

tall vine
#

You may need to put all of the shadcn Avatar components into a single Svelte component to use in your .astro page/component (and hydrate) instead, which is what you usually need to do when using shadcn (React)

scarlet yew