Answer the question
In order to leave comments, you need to log in
How to display file path with error when calling eval(CODE)?
import {transpile} from 'typescript';
eval(transpile(<ТЕКСТ ФАЙЛА>, undefined, fileName));
eval at ... <anonymous>:56:15
Answer the question
In order to leave comments, you need to log in
In general, I have so far solved this problem like this.
I compile the text, save it in os.tmpdir (), then immediately do an import. As a result, compilation errors are intelligible and runtime errors are also almost intelligible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question