From f52a860ea06c5a617edba31b6761b73f2162fd68 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Fri, 22 Jul 2022 17:20:36 -0400 Subject: [PATCH] dx: be more explicit with `emitSkipped` error - a few issues have reported that "failed to transpile" is a vague / confusing error - and `emitSkipped` actually _doesn't_ mean that it failed to transpile, as, in current versions of TS, it's not due to syntactic or semantic errors - so explicitly say "Emit skipped" instead, which is slightly less vague, in that it can actually be used as a search term - and provide a link to my TS issue that lists some reasons why `emitSkipped` occurs, since this is unfortunately otherwise undocumented by TS - in the future, hopefully that issue will be resolved and we'll be able to give better or more specific error messages, but for now this is probably the best we can do due to its undocumented nature, unfortunately --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6ec64ddf..19c7b357 100644 --- a/src/index.ts +++ b/src/index.ts @@ -216,7 +216,7 @@ const typescript: PluginImpl = (options) => // always checking on fatal errors, even if options.check is set to false typecheckFile(id, snapshot, contextWrapper); // since no output was generated, aborting compilation - this.error(red(`failed to transpile '${id}'`)); + this.error(red(`Emit skipped for '${id}'. See https://github.com/microsoft/TypeScript/issues/49790 for potential reasons why this may occur`)); } const references = getAllReferences(id, snapshot, parsedConfig.options);