File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ var compiler = {
205
205
compilerOptions : compilerOptions ,
206
206
files : options [ 'files' ] || true ,
207
207
}
208
-
208
+
209
209
try {
210
210
compiler . service = register ( tsNodeOptions )
211
211
} catch ( e ) {
@@ -269,11 +269,15 @@ var compiler = {
269
269
const errorCode =
270
270
'throw ' + 'new Error(' + JSON . stringify ( e . message ) + ')' + ';'
271
271
writeCompiled ( errorCode )
272
- // should we really re-register ts-node?
273
- compiler . registerTsNode ( )
272
+
273
+ // reinitialize ts-node compilation to clean up state after error
274
+ // without timeout in causes cases error not be printed out
275
+ setTimeout ( ( ) => {
276
+ compiler . registerTsNode ( )
277
+ } )
274
278
275
279
if ( ! compiler . options [ 'error-recompile' ] ) {
276
- return
280
+ return
277
281
}
278
282
const timeoutMs =
279
283
parseInt ( process . env . TS_NODE_DEV_ERROR_RECOMPILE_TIMEOUT ) || 5000
You can’t perform that action at this time.
0 commit comments