How to deal with internal server error: [@vue/compiler-sfc] <script setup> cannot contain ES when running vue3

The general meaning is that script setup cannot be exported using ES modules

In fact, the problem lies in the mixed use of the official methods.

One is: <script> configuration in the label setup

The other is: the configuration  method export default in the class setup()

Just use one of the two

The first 

<script setup>
import {useStore} from "../stores/store.js";
const store = useStore();
</script>

the second

<script>
import { defineComponent } from 'vue'
import {useStore} from "../stores/store.js";
export default defineComponent({
  setup() {
    const store = useStore();
    return {
      store,
    }
  }
})
</script>

Guess you like

Origin blog.csdn.net/k490031/article/details/129727265