It appears that the export default statement is not functioning properly within <script setup>
.
For example, exporting it in a file called test.vue
:
<template>
<div id="test" class="test">
</div>
</template>
<script setup>
const x = 5
export default {
x
}
</script>
<style scoped lang="scss">
</style>
and then trying to import it into another file named blog.vue
:
<script setup>
import x from './test'
</script>
This results in a cascade of errors:
app.js?id=3b6365f542826af47b926162803b3ef6:37396 Uncaught Error: Module build failed (from ./node_modules/vue-loader/dist/index.js):
TypeError: Cannot read properties of null (reading 'content')
... (error message continues)