vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Error display when the .vue file is placed inside node_modules #1451

Open XiongAmao opened 5 years ago

XiongAmao commented 5 years ago

Info

Problem

Error display when the .vue file is placed inside node_modules. Maybe the same problem here. #1327 #1388

Reproducible Case

https://github.com/XiongAmao/vetur-error-demo

Somefuture commented 5 years ago

I have the same problems, this is my infomation:

emmmm,so it must be the problems of Vetur ???

octref commented 5 years ago

By default, Vetur ignores everything under node_modules.

If you want to use this folder structure, you need to include a jsconfig.json or tsconfig.json that specifies a different exclude pattern. Read more here: https://code.visualstudio.com/docs/languages/jsconfig

ktsn commented 5 years ago

It actually does not ignore files under node_modules and if the file is under there, TS host treat them plain TS files even if they are .vue files. https://github.com/vuejs/vetur/blob/master/server/src/services/typescriptService/serviceHost.ts#L315-L327

Somefuture commented 5 years ago

By default, Vetur ignores everything under node_modules.

If you want to use this folder structure, you need to include a jsconfig.json or tsconfig.json that specifies a different exclude pattern. Read more here: https://code.visualstudio.com/docs/languages/jsconfig

I set the node_modules files include, and the js script seems normal, but the html template still have errors.

XiongAmao commented 5 years ago
<script lang="js">
   // lang="js" 
   // Error does not appear
</script>

lzl124631x commented 4 years ago

0.22.4 works but 0.22.5 doesn't!

image

image

MatteoGauthier commented 4 years ago

Up ??

yoyo930021 commented 3 years ago

Is this problem exist in new version?