When import .vue inside .js file it gives module not found in vscode
See original GitHub issueInfo
- Platform: Win
- Vetur version: 0.21.0
- VS Code version: 1.35.0
Problem
When .vue
file is imported from .js
file and checkJs
is true
in jsconfig.json
file vscode gives error that it can’t find module even though .vue
extension is included in the import please check the screenshot.
Reproducible Case
Just create new app using vue-cli and in main.js
try to ctrl + click
on App.vue
import it doesn’t take me to the App.vue
file.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
VSCode showing "cannot find module" TS error for .vue import ...
In your project workspace, bring up the command palette with Ctrl + Shift + P (macOS: Cmd + Shift + P). Type built...
Read more >[Solved]-VSCode not properly importing my main.js file-Vue.js
Coding example for the question VSCode not properly importing my main.js file-Vue.js.
Read more >Vue JavaScript Tutorial in Visual Studio Code
Vue JavaScript tutorial showing IntelliSense, debugging, and code navigation support in the Visual Studio Code editor.
Read more >Using Vue with TypeScript - Vue.js
Volar is the official VSCode extension that provides TypeScript support inside Vue SFCs, along with many other great features.
Read more >Create a Vue.js app using Node.js - Visual Studio (Windows)
For .vue files, you need to use WebPack or a similar framework with a loader to do the conversion. TypeScript and Visual Studio...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When use
.ts
or.js
files, VSCode usetypescript-language-server
in VSCode built-in. It don’t know.vue
file, It usevue-shims.d.ts
file to know.When use
.vue
files, VSCode usevue-language-server
invetur
. It can know.vue
file by itself, so can get more info.The above is my guess.
@yoyo930021 here is the
jsconfig.json
content