-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volar cannot deduce component type correctly #355
Comments
I can't reproduce it on https://github.com/antfu/vitesse |
Steps to reproduce https://github.com/jsonleex/issue-355
Vue.js - The Progressive JavaScript Framework
✔ Project name: … issue-355
✔ Add TypeScript? … No / Yes
✔ Add JSX Support? … No / Yes
✔ Add Vue Router for Single Page Application development? … No / Yes
✔ Add Pinia for state management? … No / Yes
✔ Add Vitest for Unit Testing? … No / Yes
✔ Add Cypress for End-to-End testing? … No / Yes
✔ Add ESLint for code quality? … No / Yes
✔ Add Prettier for code formatting? … No / Yes
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
Components({
dirs: ['src/components'],
dts: 'src/components.d.ts',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})
<template>
<RouterView />
<HelloWorld />
</template> |
The difference between the two repositories is Maybe this bug is caused by Volar, but can resolved by adding |
https://github.com/jsonleex/issue-355/blob/main/tsconfig.app.json#L3 Your tsconfig does not include the |
https://github.com/jsonleex/issue-355/blob/main/vite.config.ts#L14
|
I've also had this happening recently. #344 is what broke it for me but only when installing with Adding either |
Using |
When I using storybook with vite project, this problem occurred again. @antfu |
i have the same problem,solved the question by your methods,3q. |
Question
Solution
The text was updated successfully, but these errors were encountered: