17 questions
0
votes
1
answer
57
views
The global component not found In the TSX file ! Vue3 + vite + TS
1. Project initialization with Vite.js
pnpm create vite
√ Project name: ... demo
√ Select a framework: » Vue
√ Select a variant: » Customize with create-vue ↗
$ Vue.js - The Progressive JavaScript ...
2
votes
2
answers
393
views
Vue 3 Dynamic Slots causes error TS2339 on vue-tsc
I have a tab component in a vue 3 (3.5.12) typescript project. The tabs accept a prop called nav which might look something like this:
const nav = ref([
{
id: 'about',
...
1
vote
1
answer
90
views
VueWrapper error after typescript update to v5.5.2
When I update my project's TypeScript dependency to the version v5.5.2 from 5.4.5 it completely breaks my checks in test.ts files specifically with VueWrapper type, I use vitest.
type error
My usual ...
0
votes
1
answer
124
views
vue-tsc type error using v-select templates and props
Using vue 3.4.31, vuetify 3.6.12, and vue-tsc 2.0.26. I'm trying to use a custom template with a v-select and when I build I get:
TS2339: vuetify v-select Property 'props' does not exist on type '{ ...
0
votes
2
answers
786
views
VSCode show errors in editor from vue-tsc
I have a Vue3 app and using VSCode. Using the npm run type-check command will show me the vue-tsc errors. I'm trying to find a way to show these errors in VSCode, like eslint does.
Does anybody know ...
8
votes
1
answer
8k
views
vue-tsc failing with Error "Referenced Project may not disable emit" on vue project
When updating my project to use the latest @vue/tsconfig version (version 0.5.1 as of this writing) the command vue-tsc fails with error
Referenced project 'd:/repos/project/tsconfig.node.json' may ...
7
votes
0
answers
2k
views
How to set up vue-tsc to properly work with lint-staged (staged files)?
With a recent introduction of TypeScript to a project, our team decided not to do a full-blown type check inside a CI pipeline, but rather fix the problems gradually. One plan was to run a compiler on ...
1
vote
0
answers
409
views
What the difference between writing typescript configuration in package.json with vue-tsc or in tsconfig.json?
I'm working on a project using typescript & vue3 & vite. It's a common component library, so when I build this project, I have to generate .d.ts declaration files.
I have tried in two ways:
...
0
votes
0
answers
187
views
how to properly accept props for child in vue
Suppose you have a component my-select, with a template like
<template>
<div class='my-select'>
<MyButton v-bind="attrs"/>
...
</div>
</template>
...
1
vote
0
answers
691
views
Vue 3 / Vite: Imports are generated for excluded external SVG file
I have a Vue 2 app that I am upgrading to Vue 3. JavaScript Imports are incorrectly being generated for .svg files that have been marked as external resources. This causes an error when the browser ...
0
votes
1
answer
36
views
Avoid TS2571 when using $refs inside a template
Assuming SomeComp is a custom component exposing a function open, in a template I can do this:
<button @click="$refs.someComp.open()">Open</button>
<SomeComp ref="...
0
votes
2
answers
1k
views
How to properly add a global property to work in a component template? (Vue 3, vite, typescript, composition api)
The property does not work in the component
src/main.ts
import { createApp } from 'vue'
import languagePlugin from '@/plugins/languagePlugin'
import App from './App.vue'
const app = createApp(App)
...
8
votes
2
answers
2k
views
Vue-tsc shows an error badge but reports 0 errors
After upgrading from NUXT 3 Release candidate to the latest and released version and making the changes I needed in order to get everything running smoothly, vue-tsc has started showing an error-badge ...
1
vote
1
answer
64
views
vue ts type for current instance
I keep getting a ts error type:
Propery Instance does not exist on HTMLElement. I get my element in query selector and then in onmounted I access _instance. what type should I use to stop getting this ...
1
vote
2
answers
2k
views
Why my console does not shows types errors in typescript
I recently started a vue3 project and decided to use TypeScript. Once I had studied some basics I intentionally made a typing mistake but no error appeared:
<script setup lang="ts">
...
3
votes
2
answers
978
views
JSX element type 'RouterLink' does not have any construct or call signatures
I've found a lot of issues regarding this across the internet and stack overflow, however, the problem always seems to be with React? like this one, however, I am using Vue and the error happens to ...
0
votes
1
answer
2k
views
Why does vue-tsc think it should look for Vue Test Utils types in my custom types file?
I have a simple project built with Vite, Vue3, TypeScript and Jest for testing.
I have a Vue component called Btn.vue that import a Variant type from my @/types/index.d.ts. (Note that the @ alias is ...