#can't import vue composables in vue component in astro
1 messages · Page 1 of 1 (latest)
Hi @drowsy cradle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the information provided in the extracts, it seems like you're having trouble importing Vue composables in a Vue component within an Astro project. Unfortunately, the extracts do not provide a direct solution to this specific issue.
However, there are a few general tips that might help:
-
Ensure that the Vue integration is properly set up in your Astro project. You can do this by adding
@astrojs/vueto theintegrationsarray in your Astro configuration file (source (https://github.com/withastro/astro/issues/8947)). -
If you're working in a monorepo setup, make sure to add Astro-related dependencies (like
@astrojs/vue) to thevite.ssr.noExternalpart of Astro’s config. This ensures that these dependencies are properly installed and bundled (source (https://docs.astro.build/en/guides/troubleshooting#adding-dependencies-to-astro-in-a-monorepo)). -
If you're dynamically importing components, be aware that completely dynamic imports might not be possible in Astro due to limitations of Vite (source (https://github.com/withastro/astro/issues/6224)).