-
Notifications
You must be signed in to change notification settings - Fork 497
Closed
@pholly
Description
When creating a new app with TypeScript, any imports using absolute path syntax '@/' show as errors in Visual Studio Code with the Volar extension. The app still runs fine.
Steps to reproduce:
IDE: Visual Studio Code
Extension: Volar
npm init vue@3
Typescript support: yes
Everything else: no
pnpm install (or npm install)
Change an import to use @/
absolute syntax, such as in App.vue
change the HelloWorld.vue import to import HelloWorld from '@/components/HelloWorld.vue'
There will now be a red line error: Cannot find module '@/components/HelloWorld.vue' or its corresponding type declarations.ts(2307)
Note: if you choose to install router when configuring create-vue, App.vue
will already use the absolute path syntax and have an error.
Extra info
- I use Visual Studio Code + Volar extension for other vue 3 vue cli TypeScript projects and don't have the problem.
Metadata
Metadata
Assignees
Labels
No labels