Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec.
TypeError: Failed to fetch dynamically imported module: host/static/js/datatable/components/asynccomp.vue
<template>
<div>Main APP</div>
<div>
<component
:is="asynccomp"
></component>
</div>
</template>
<script setup>
import { shallowRef, defineAsyncComponent } from 'vue'
const asynccomp= shallowRef(null)
asynccomp.value = defineAsyncComponent(() => import("./components/asynccomp.vue"));
</script>
<template>
<div>
<h2>Async loaded component</h2>
</div>
</template>
<script setup>
import { ref } from 'vue'
onMounted(() => {
console.log("Async mounted!")
})
</script>
mimetypes.add_type("application/javascript", ".vue", True)
export default {
props: {
},
data() {
return {
hellow: String
}
},
mounted() {
console.log("Acomp loaded!")
this.hellow = "Hello!"
},
template: `<div>
<h2>ALoad component {{ hellow }}</h2>
</div>`
}