Closed buglavecz closed 1 year ago
I seems this error come only if I use composition API, and script setup syntax.
Maybe it's an issue with your editor's Vue integration? I suppose it's not Volar or Vetur but maybe Jetbrains own one? I don't have experience with that.
Yes, jetbrain IDE . But I tried with script setup syntax and setup() function. With setup() function working fine, but with script setup no. I saw, the examples also use setup() function...
If you provide a repo I can try and see if I can reproduce. But again, if Nuxt and Volar doesn't complain then it sounds like an issue with Editor integration that does the type checking.
With this syntax setup syntax...
<template>
<b-container class="mt-3">
<h3>Composition API</h3>
{{ fruit }}
</b-container>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
setup () {
interface Apple {
id: number,
name: string,
weight?: number
}
const fruit:Apple[] = [
{
id: '10',
name: 'jonatan'
},
{
id: 20,
name: 'golden'
}
];
return { fruit };
}
});
</script>
I got this TS error in terminal:
But, If I use Githubissues.
Describe the bug We want use nuxt 2 with typescript support, but I don't understand why don't break the build, if the TS code is bad?
Screenshots
Additional context I tried add the
--fail-on-error
flag to package.json, but not working.... 🤔Thanks.