Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm facing an error with vue3, ts, vue cli where it says
Module '"c:/Users/USER/Documents/top-secret-project/src/components/Features/Features.vue"' has no default export.
when importing a component from a file
I have no idea why did this specific component decide to now work.
here's Features.vue
<script lang="ts">
import Feature from "./Feature.vue";
</script>
<template>
<Feature />
</template>
–
A @Boussadjra mentioned this could happen in Visual Studio Code if Vetur extension is installed there.
Insetted of Vetur
if we install Volar
extension in Visual Studio Code this problem gets solved.
–
With script setup syntax there's no need to add export default
in your script, just add the setup
attribute to your script:
<script lang="ts" setup>
import Feature from "./Feature.vue";
</script>
<template>
<Feature />
</template>
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.