Open jerry84 opened 3 months ago
@Princesseuh Is this a known issue? Any idea on how to deal with this?
I don't know, seems like a bug. I haven't investigated yet
This may be related to #782. In VS Code I'm getting the 'no default export' error when I use defineProps with a default array, which led me to find that ticket and then this one. If you modify this ticket's sample code's Counter.vue's defineProps to add an array,
const props = defineProps({
value: {
type: Number,
default: 0,
},
tags: {
type: Array,
default(raw) {
return []
}
}
});
Instead of getting the original error from this bug you get the 'no default export' error instead. Also if you use the unmodifed example in #782 and run 'npx astro check' you also get the 'no default export' error (after removing the unused import FormattedDate
line in index.astro because that trips up astro check first).
I manage to solve this issue by using type-based
declaration instead of runtime
. I guess it is the best practice when using Vue
component in Astro
. In addition the typing is also better by doing that in the Astro
file :)
Describe the Bug
When I import a
Vue
component in an Astro file, it complains on optional properties when runningastro check
This seems to happen from
astrojs/check@0.5.5
Steps to Reproduce
Vue
component.astro
file without defining a value for the optional propertyastro check
Link to an reproducible example