title: How do you export default from inside script setup in Vue 3?
body: <p>The export default statement does not seem to work inside <code>&lt;script setup&gt;</code>.</p>
  <p>If I try to export it in <code>test.vue</code>:</p>
  <pre><code>&lt;template&gt;
    &lt;div id=&quot;test&quot; class=&quot;test&quot;&gt;
  
    &lt;/div&gt;
  &lt;/template&gt;
  
  
  &lt;script setup&gt;
  const x = 5
  
  export default {
      x
  }
  &lt;/script&gt;
  
  
  &lt;style scoped lang=&quot;scss&quot;&gt;
  &lt;/style&gt;
  </code></pre>
  <p>and then importing it into another <code>blog.vue</code>:</p>
  <pre><code>&lt;script setup&gt;
  import x from './test'
  &lt;/script&gt;
  </code></pre>
  <p>I am getting this bulk of error:</p>
  <pre><code>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')
      at selectBlock (:3000/Users/artur/PhpstormProjects/safa-ameedee.com/node_modules/vue-loader/dist/select.js:23:45)
      at Object.loader (:3000/Users/artur/PhpstormProjects/safa-ameedee.com/node_modules/vue-loader/dist/index.js:67:41)
      at Object../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/vue/backend/components/test.vue?vue&amp;type=script&amp;setup=true&amp;lang=js (app.js?id=3b6365f542826af47b926162803b3ef6:37396:7)
      at __webpack_require__ (app.js?id=3b6365f542826af47b926162803b3ef6:64806:42)
      at Module../resources/vue/backend/components/test.vue?vue&amp;type=script&amp;setup=true&amp;lang=js (app.js?id=3b6365f542826af47b926162803b3ef6:60116:217)
      at __webpack_require__ (app.js?id=3b6365f542826af47b926162803b3ef6:64806:42)
      at Module../resources/vue/backend/components/test.vue (app.js?id=3b6365f542826af47b926162803b3ef6:59477:102)
      at __webpack_require__ (app.js?id=3b6365f542826af47b926162803b3ef6:64806:42)
      at Module../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/vue/backend/components/blog.vue?vue&amp;type=script&amp;setup=true&amp;lang=js (app.js?id=3b6365f542826af47b926162803b3ef6:37336:63)
      at __webpack_require__ (app.js?id=3b6365f542826af47b926162803b3ef6:64806:42)
      at Module../resources/vue/backend/components/blog.vue?vue&amp;type=script&amp;setup=true&amp;lang=js (app.js?id=3b6365f542826af47b926162803b3ef6:60084:217)
      at __webpack_require__ (app.js?id=3b6365f542826af47b926162803b3ef6:64806:42)
  ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/vue/backend/components/test.vue?vue&amp;type=script&amp;setup=true&amp;lang=js @ app.js?id=3b6365f542826af47b926162803b3ef6:37396
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/vue/backend/components/test.vue?vue&amp;type=script&amp;setup=true&amp;lang=js @ app.js?id=3b6365f542826af47b926162803b3ef6:60116
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/vue/backend/components/test.vue @ app.js?id=3b6365f542826af47b926162803b3ef6:59477
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/vue/backend/components/blog.vue?vue&amp;type=script&amp;setup=true&amp;lang=js @ app.js?id=3b6365f542826af47b926162803b3ef6:37336
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/vue/backend/components/blog.vue?vue&amp;type=script&amp;setup=true&amp;lang=js @ app.js?id=3b6365f542826af47b926162803b3ef6:60084
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/vue/backend/components/blog.vue @ app.js?id=3b6365f542826af47b926162803b3ef6:59328
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/js/router.js @ app.js?id=3b6365f542826af47b926162803b3ef6:39847
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  ./resources/js/app.js @ app.js?id=3b6365f542826af47b926162803b3ef6:39770
  __webpack_require__ @ app.js?id=3b6365f542826af47b926162803b3ef6:64806
  (anonymous) @ app.js?id=3b6365f542826af47b926162803b3ef6:64971
  __webpack_require__.O @ app.js?id=3b6365f542826af47b926162803b3ef6:64843
  (anonymous) @ app.js?id=3b6365f542826af47b926162803b3ef6:64973
  (anonymous) @ app.js?id=3b6365f542826af47b926162803b3ef6:64975
  </code></pre>