Search code examples
typescriptvue.jsvuejs3vue-composition-apivetur

Vetur says prop doesn't exist on type "never" when using a prop on template


I am using Quasar framework with vue composition API and typescript on VSCode.

When trying to use a prop in the template, Vetur is giving me the error in the template Property 'open' does not exist on type 'never'

Source

<template>
  <q-drawer v-model="open">
    test
  </q-drawer>
</template>

<script lang="ts">
import { defineComponent, ref } from '@vue/composition-api';

export default defineComponent({
  name: 'AuthedLayout',
  props: {
    open: {
      type: Boolean,
      required: true
    }
  },
  components: {},
  setup() {}
});
</script>

<style></style>

Any help is appreciated


Solution

  • Found the issue. It was because I didn't have a return in the setup function. The error is misleading