From 5fcc2bebbf31e2393cf7e162071b5c1ce847662b Mon Sep 17 00:00:00 2001 From: uellenberg Date: Thu, 2 Oct 2025 22:18:26 -0700 Subject: [PATCH] [playground] Report non-error-severity errors on compile failure error.hasErrors() only returns true on error-severity errors. However, non-error-severity errors (in this case, todos / hint severity) caused invokeCompiler to throw an error. This caused transformOutput to be returned as undefined, breaking the playground and hiding the errors. Fixes #34657 --- compiler/apps/playground/components/Editor/EditorImpl.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/apps/playground/components/Editor/EditorImpl.tsx b/compiler/apps/playground/components/Editor/EditorImpl.tsx index 9f000f85564..57921015fa3 100644 --- a/compiler/apps/playground/components/Editor/EditorImpl.tsx +++ b/compiler/apps/playground/components/Editor/EditorImpl.tsx @@ -207,7 +207,7 @@ function compile( } else { language = 'typescript'; } - let transformOutput; + let transformOutput: CompilerTransformOutput; let baseOpts: PluginOptions | null = null; try { @@ -302,7 +302,7 @@ function compile( if (!error.hasErrors() && otherErrors.length !== 0) { otherErrors.forEach(e => error.details.push(e)); } - if (error.hasErrors()) { + if (error.hasErrors() || !transformOutput) { return [{kind: 'err', results, error}, language, baseOpts]; } return [