VSCode showing "cannot find module" TS error for .vue import while compiling doesn't
01:02 23 Feb 2019

Simply put, vscode is showing this error in a module:

Cannot find module '@/components/SidebarToggleIcon'

But no such error shows up during compilation.

This is a VueJS project and SidebarToggleIcon is a .vue file with TypeScript in the

SidebarToggleIcon.vue


enter image description here

Why is this? How do I solve this?

Edit: This is not an issue with the @ alias, those resolve correctly (in the screenshot the line above the error uses it, and I use it elsewhere in the project), this error still shows up when using relative paths. My TSConfig has the appropriate "paths": { "@/*": ["src/*"] } item. If this was the issue compiling would also throw this error, which it does not, this is only present in VSCode.

typescript vue.js vs-code