-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught errors when target JS file exists and MAP file doesn't exist #362
Comments
Thanks for the report! I think I'm going to bundle this and #355 into a more permanent fix. Not entirely sure how, but checking two files before every load may get a little expensive so it might be worth looking into trying to use a single cache file loaded on start-up and periodically writing it back to the filesystem. What do you think? |
It'd also be even easier to combine the source map and JavaScript file into a single file here instead of having two files output - this would be a better temporary solution until the idea above is implemented. |
Totally agree. I was a bit shocked when I discovered that ts-node is performing synchronous i/o operations (fileExists) for errors each time. If you need some help here, I can join.
Yep, this was a easiest solution I came up with after some time. I just thought it would be useful for ts-node if I report it here. |
@1999 I did #368, which merges the two files together. On the single file cache - I'd be happy to do that in the next major release. I haven't thought about how it might interact with multiple processes and such, but just reading it at startup and writing on each batched compilation feels reasonably suitable. |
This is a problem I faced today and spent couple of hours working on. it looks like source map file generation failed for some reason for me. After that my ts-node process was working fine until error occured. It was trying to build the stack trace from source maps: the cache.sourceMaps contained information about the file but the map file didn't exist in the file system: https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L172
The problem is that fileExists only checks the target file: https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L485
The text was updated successfully, but these errors were encountered: