I’m trying to import a default export from a module in Vue 3 and I’m getting the following error –
Uncaught SyntaxError: The requested module '/src/views/FlashcardView.vue?t=1648376545088' does not provide an export named 'FlashcardView'
I’m trying to import this component –
*** Flashcardview.vue ***
<script lang="ts">
export default {
name: "FlashcardView",
methods: {
flipCard() {
document.getElementById("flashcard-container").style.backgroundColor = "red";
}
}
}
</script>
into my root component –
<script lang="ts">
import { RouterView } from "vue-router";
import FlashcardView from "./views/FlashcardView.vue";
export default {
name: "App",
components: {
Router: RouterView,
FlashcardApp: FlashcardView
}
}
</script>
According to this page – Uncaught SyntaxError: The requested module ‘./add.js’ does not provide an export named ‘add’ I’m doing the right thing by importing my default export without the curly braces.
So… What gives?