vue3-sfc-loader icon indicating copy to clipboard operation
vue3-sfc-loader copied to clipboard

Error parse script on defineProps

Open jfrank14 opened this issue 2 years ago • 0 comments

I'm trying to run the SFC loader on the out of the box application generated by vue. This app has an App.vue that references a component HelloWorld.vue that does this:

<script setup lang="ts">
defineProps<{
  msg: string
}>()
</script>

When I do this, I get the following error in the browser:

error parse script /vue/src/components/HelloWorld.vue
  4 |   props: {
  5 |     msg: { type: String, required: true }
> 6 |   } as unknown as undefined,
    |     ^ Unexpected token, expected "," (6:4)
  7 |   setup(__props: {
  8 |   msg: string
  9 | }, { expose }) {

Does the parser not know how to handle the new defineProps syntax?

jfrank14 avatar May 17 '22 16:05 jfrank14