language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

🐛 BUG: Using Vue component with optional properties in Astro file cause type error

Open jerry84 opened this issue 2 years ago • 5 comments

Describe the Bug

When I import a Vue component in an Astro file, it complains on optional properties when running astro check

This seems to happen from astrojs/[email protected]

Steps to Reproduce

  1. add a optional property to a Vue component
<script setup lang="ts">
const props = defineProps({
  value: {
    type: Number,
    default: 0,
  },
});
</script>
  1. import the component in .astro file without defining a value for the optional property
---
import Example from '../components/Example.vue';
---
<Example  client:visible />
  1. run astro check

Link to an reproducible example

jerry84 avatar Apr 03 '24 12:04 jerry84

@Princesseuh Is this a known issue? Any idea on how to deal with this?

jerry84 avatar Apr 08 '24 16:04 jerry84

I don't know, seems like a bug. I haven't investigated yet

Princesseuh avatar Apr 08 '24 16:04 Princesseuh