[英]ts-node-dev not printing ts errors
I use ts-node-dev
for compile and run my node app.我使用
ts-node-dev
编译和运行我的节点应用程序。
ts-node-dev -r tsconfig-paths/register src/collectDayMatches.ts
But ts-node-dev
printing just runtime errors (not ts errors).但是
ts-node-dev
只打印运行时错误(不是 ts 错误)。
if I use tsc
for the build app, I get errors as expected.如果我将
tsc
用于构建应用程序,我会得到预期的错误。
tsconfig.json: 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/*"]
}
}
}
I had the same problem because I was passing --transpile-only
to ts-node-dev.我遇到了同样的问题,因为我将
--transpile-only
传递给 ts-node-dev。 When I removed --transpile-only
, TypeScript errors were being printed and compile interrupted.当我删除
--transpile-only
时,正在打印 TypeScript 错误并中断编译。
Ignores TypeScript error:忽略 TypeScript 错误:
ts-node-dev --respawn --transpile-only -r tsconfig-paths/register src/index.ts
Reports TypeScript error:报告 TypeScript 错误:
ts-node-dev --respawn -r tsconfig-paths/register src/index.ts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.