-
-
Notifications
You must be signed in to change notification settings - Fork 379
Closed
Description
Describe the bug
I referenced the unplugin-auto-import/vite plug-in in the new project, but the typescript compilation reported an error, as shown in the figure below.

this is my vite config:
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { VantResolver } from '@vant/auto-import-resolver'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
Components({
resolvers: [VantResolver()],
dts: 'typings/vue-component.d.ts'
}),
AutoImport({
imports: ['vue', 'vue-router'],
dts: 'typings/auto-import.d.ts',
eslintrc: {
enabled: false // <-- this
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})Reproduction
https://github.com/XBIsland/issue-vite-demo-1
System Info
System: Windows
Node: 18.17.1
Typescript: 5.2Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Metadata
Metadata
Assignees
Labels
No labels