Vetur: Error display when the .vue file is placed inside node_modules

Created on 8 Oct 2019  路  8Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win10 WSL Ubuntu 18.04
  • Vetur version: 0.22.4
  • VS Code version: 1.38.1

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

bug

Most helpful comment

<script lang="js">
   // lang="js" 
   // Error does not appear
</script>

All 8 comments

I have the same problems, this is my infomation:

  • Platform: macOS 10.13.6
  • Vetur version: 0.22.4
  • VS Code version: 1.39.1

emmmm锛宻o it must be the problems of Vetur ???

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

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

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.

<script lang="js">
   // lang="js" 
   // Error does not appear
</script>

0.22.4 works but 0.22.5 doesn't!

image

image

Up ??

Is this problem exist in new version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AnnAngela picture AnnAngela  路  3Comments

sacki5 picture sacki5  路  3Comments

deangoku picture deangoku  路  3Comments

LukeLin picture LukeLin  路  3Comments

shaunc picture shaunc  路  3Comments