Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
XiongAmao opened this issue Oct 8, 2019 · 9 comments
Open
3 tasks done

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

XiongAmao opened this issue Oct 8, 2019 · 9 comments
Labels

Comments

@XiongAmao
Copy link

  • I have searched through existing issues
  • I have read through docs
  • 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

@Somefuture
Copy link

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,so it must be the problems of Vetur ???

@octref
Copy link
Member

octref commented Oct 23, 2019

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

@octref octref closed this as completed Oct 23, 2019
@octref octref reopened this Oct 23, 2019
@ktsn
Copy link
Member

ktsn commented Oct 24, 2019

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
Copy link

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
Copy link
Author

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

@ktsn ktsn mentioned this issue Nov 7, 2019
3 tasks
@lzl124631x
Copy link

0.22.4 works but 0.22.5 doesn't!

image

image

@MatteoGauthier
Copy link

Up ??

@yoyo930021
Copy link
Member

Is this problem exist in new version?

@Sowmo0509
Copy link

Sowmo0509 commented Jan 1, 2025

Same error currently occurs for <script setup lang="ts">, but not for lang="js".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants