Skip to content

tsc --noEmit does not detect issues in react-ts template #17585

@JElgar

Description

@JElgar

Describe the bug

After adding type errors in project tsc not showing any errors when run (npx tsc -w) in react-ts template.

Reproduction

https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts

Steps to reproduce

  1. Clone https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts or open https://vite.new/react-ts
  2. Open src/main.tsx and add const a: string = 2 somewhere
  3. Run npx tsc --noEmit

tsc will say there is no issue (when it should be complaining about the line we just added

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 
    vite: ^5.3.1 => 5.3.2

Used Package Manager

npm

Logs

~/projects/vitejs-vite-whkhm3 2s
❯ npx tsc --noEmit

^ there is no output

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions