应用笔记 · 2023年10月8日

webstorm IDE vue resolve ERROR “cannot find module or its corresponding type declarations”

The key is  *.vue file not included in your env options.

If you have env.d.ts in your project, add these lines to it.

If your project have file tsconfig.json

Modify the “include” section to cover the full path of your .vue file.

My original lines with above error:

But my project have file path like src/view/login/index.vue, it’s obviously not covered by the above pattern.

Just add “src/**/**/*.vue”, problem resolved.

Plus: Or just edit the tsconfig.json forced IDE refreshing?