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

Volar causes errors on all *.vue files when you have a vite project in subdirectory inside another TypeScript project #1276

Closed
segevfiner opened this issue May 8, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@segevfiner
Copy link
Contributor

segevfiner commented May 8, 2022

Volar with the TypeScript Vue Plugin, seems to be causing the following error repeatedly on all *.vue files:

Error
[{
	"resource": "/Users/segevfiner/junk/volar-nested-project-bug/tsconfig.json",
	"owner": "typescript",
	"severity": 8,
	"message": "File '/Users/segevfiner/junk/volar-nested-project-bug/web/src/App.vue' is not under 'rootDir' '/Users/segevfiner/junk/volar-nested-project-bug/src'. 'rootDir' is expected to contain all source files.\n  The file is in the program because:\n    Root file specified for compilation",
	"source": "ts",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}]

In a project that has a root project with a tsconfig.json and a subproject with a Vite app created with npm create vue@3.

Steps to reproduce:

  1. git clone https://github.com/segevfiner/volar-nested-project-bug && code volar-nested-project-bug.
  2. Open src/hello.ts.
  3. The problems view will be filled with errors like described.

It seems like Volar is trying to forcibly apply the root tsconfig.json in the project to the *.vue files instead of using the one in the subdirectory.

Versions:
VS Code 1.67.0
macOS 12.3.1
Volar & TypeScript Vue Plugin v0.34.11
TypeScript 4.6.4
Node 16.15.0

@johnsoncodehk johnsoncodehk added the bug Something isn't working label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants