-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
tsconfig.node.json should not be included in tsconfig.json references #11396
Comments
happy to make a PR with the fix if this is confirmed to be indeed removable |
It's because the project is missing the |
Installing that dependency does also fix the build errors. However, the dependency is not in the template and nothing in the template seems to ever build what |
vite.config.ts is bundled by vite with esbuild. so that config is used. |
It was my first assumption as well since |
I've been looking into this, and a lot about this starter project's config doesn't make much sense to me. According to the original issue #6324, importing something in vite.config.ts would pollute the global types such that the code in
Then they said that they resolved the issue by splitting the ts configs via
So I don't understand what was going on in that issue. The solution does not solve the problem. The only way a scheme like this could work is by specifying |
I also used to think that there was more to I'm deleting it as well. Project References aren't intended for this purpose. |
Just shimming in a few months later. I personally think that |
I'd also like to chime in because since my previous comment I learned an important trick in project references. I used to think that they have to emit something, but it turns out that we can use them to connect projects that don't emit, by creating a config with an empty {
"includes": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
Now running I read about the importance of separating type-checking environments, so I've come to appreciate the intent here, but I think the current implementation is wrong because running It's a shame that project references are so heavily underdocumented. |
Describe the bug
The reason I stumbled upon this is because I am using TypeScript Project References and
tsc --build
fails with a few type errors likein the blank React TypeScript template.
That said, removing
{ "path": "./tsconfig.node.json" }
fromtsconfig.json
does neither seem to breaknpm run dev
nornpm run build
in the template and then allowstsc --build
to complete successfully. It doesn't seem like anything actually expects this include to exist? #6324 doesn't regress for me with the line removed.Reproduction
https://stackblitz.com/edit/vite-react-ts?file=package.json
Steps to reproduce
Open https://stackblitz.com/edit/vite-react-ts?file=package.json and run
tsc --build
in the terminalSystem Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: