Closed JElgar closed 2 months ago
You need to run tsc -b
instead of tsc --noEmit
.
But that might be not intuitive. Maybe this could be one reason to revert #15913 and merge the tsconfigs (https://github.com/vitejs/vite/pull/15913#:~:text=Maybe%20removing%20tsconfig.node.json%20and%20adding%20vite.config.ts%20to%20include%20of%20tsconfig.json%20is%20better%3F%20%F0%9F%A4%94%20It%20doesn%27t%20have%20much%20benefit%20of%20having%20it%20in%20the%20current%20state%20(%2311396%20(comment))).
Probably just repeating OP here, but the same holds for those of us using tsc -w
as our compile error monitor. I just created a new Typescript + React project with npm create vite@latest
, and tsc -w seems to have trouble unless I merge the tsconfigs myself.
You need to run tsc -b
Thanks that does the trick!
But that might be not intuitive
I agree, having a root tsconfig with no included files and then 2 tsconfigs both marked with no emit takes a bit of getting used to. That being said I'm not super familiar with this stuff so that might just be me.
Closing this as the issue is of the missing -b
flag not passed, and not an issue with the template in general. However, we have been discussing and working on removing the "solutions" setup, which had caused other confusions like https://github.com/vitejs/vite/issues/17638
Describe the bug
After adding type errors in project
tsc
not showing any errors when run (npx tsc -w) inreact-ts
template.Reproduction
https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts
Steps to reproduce
src/main.tsx
and addconst a: string = 2
somewherenpx tsc --noEmit
tsc will say there is no issue (when it should be complaining about the line we just added
System Info
Used Package Manager
npm
Logs
~/projects/vitejs-vite-whkhm3 2s ❯ npx tsc --noEmit
^ there is no output
Validations