diff --git a/lib/internal/modules/typescript.js b/lib/internal/modules/typescript.js index 5a240a6a540..993fd3ff72d 100644 --- a/lib/internal/modules/typescript.js +++ b/lib/internal/modules/typescript.js @@ -49,7 +49,7 @@ function parseTypeScript(source, options) { try { return parse(source, options); } catch (error) { - throw new ERR_INVALID_TYPESCRIPT_SYNTAX(error); + throw new ERR_INVALID_TYPESCRIPT_SYNTAX(error.message); } }