ts-node exits when there are typescript errors

Created on 18 Jun 2018  路  9Comments  路  Source: TypeStrong/ts-node

I am new to typescript and I am migrating javascript project (express server) over to typescript.

When I use tsc, it outputs many typescript errors (as I am in process of addressing these errors), but still outputs js files, which can be run and thats great as it takes time to adapt the code base. I can't figure out why ts-node does not behave same way and exits based on these typescript errors.

tsc has --noEmitOnError option if someone wants to be strict and not emit the js files. I would expect same from ts-node. Meaning that it shows the errors but still run the thing if noEmitOnError is false and only exit on type errors when noEmitOnError is true.

I am surprised that I could not find any discussion on this topic as I would expect many people run into this issue.

duplicate

Most helpful comment

Is this implemented?
How can I disable or ignore warnings today?

All 9 comments

See https://github.com/TypeStrong/ts-node/issues/34. You鈥檙e welcome to submit a PR, but since only a few of people out of millions of downloads have expressed a need for this it doesn鈥檛 seem high priority. I don鈥檛 know what the semantics of it really be if the compiler is outputting error messages in between application logs.

Is this issue solved or just closed?
There's a case tsc compiles without error and ts-node exits without any error log.
In this case, user cannot find what goes wrong with ts-node.
I hope ts-node emits error when ts-node exits!

That鈥檚 literally how it works today. Maybe you have no errors if you say TypeScript compiles? Why would you expect an error when there鈥檚 no error?

We've run into the same problem. ts-node used to kind of support this feature with the disableWarnings option in v3.3.0 (except it also hid the errors).

Our codebase is being refactored into TypeScript, and there are some type errors, and this prevents our test suite with Mocha using ts-node from running at all.

As for error messages being interleaved with the rest of the application logging, it's probably more useful than anything for the case of running a test suite.

@kvcrawford You're welcome to submit a PR. Also happy to enable disableWarnings again.

@blakeembrey if you could enable disableWarnings again that would be awesome. We'll also consider investing some time in a PR for #34

Is this implemented?
How can I disable or ignore warnings today?

same question + 1

The parameter is --log-error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sodiumjoe picture sodiumjoe  路  4Comments

remojansen picture remojansen  路  4Comments

sanex3339 picture sanex3339  路  4Comments

JoseLion picture JoseLion  路  3Comments

conordickinson picture conordickinson  路  4Comments