Edgaras Karka
Edgaras Karka

Reputation: 7852

ts-node-dev not printing ts errors

I use ts-node-dev for compile and run my node app.

ts-node-dev -r tsconfig-paths/register src/collectDayMatches.ts

But ts-node-dev printing just runtime errors (not ts errors).

if I use tsc for the build app, I get errors as expected.

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2019",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "dist",
    "strict": true,
    "inlineSourceMap": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "allowJs": false,
    "lib": ["es2016", "esnext.asynciterable", "webworker"],
    "types": ["node"],
    "allowSyntheticDefaultImports": true,
    "strictPropertyInitialization": false,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "forceConsistentCasingInFileNames": true,
    "pretty": true,
    "baseUrl": "./src",
    "paths": {
      "utils/*": ["utils/*"]
    }
  }
}

Upvotes: 0

Views: 829

Answers (1)

Johnny Oshika
Johnny Oshika

Reputation: 57502

I had the same problem because I was passing --transpile-only to ts-node-dev. When I removed --transpile-only, TypeScript errors were being printed and compile interrupted.

Ignores TypeScript error:

ts-node-dev --respawn --transpile-only -r tsconfig-paths/register src/index.ts

Reports TypeScript error:

ts-node-dev --respawn -r tsconfig-paths/register src/index.ts

Upvotes: 2

Related Questions