Home > other >  Why does tsc command emit an error even though vite command works?
Why does tsc command emit an error even though vite command works?

Time:12-09

I'm trying to run tsc on a React project scaffolded with Vite -- all other commands run fine and the project loads and builds successfully, but when running tsc I get this error:

../../node_modules/@types/download/index.d.ts:9:10 - error TS2614: Module '"got"' has no exported member 'GotEmitter'. Did you mean to use 'import GotEmitter from "got"' instead?

9 import { GotEmitter, GotOptions } from "got";
           ~~~~~~~~~~

../../node_modules/@types/download/index.d.ts:13:58 - error TS2315: Type 'GotOptions' is not generic.

13     interface DownloadOptions extends DecompressOptions, GotOptions<string | null> {
                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~

I can see it's related to a types module that I didn't even install myself. Any idea where this comes from?

CodePudding user response:

you could try to put

  "compilerOptions": {
    "skipLibCheck": true
  },

into your tsconfig file. This will skip the type check for node_modules.

  • Related