From 3d9d22cbdbfc1df2ec1d2ca00cb824e36af46ab8 Mon Sep 17 00:00:00 2001 From: Eugene Choi <4eugenechoi@gmail.com> Date: Mon, 8 Sep 2025 15:06:54 -0400 Subject: [PATCH] [playground] Fix CompilerError mismatch (#34420) The compiler playground was crashing at any small syntax errors in the `Input` panel due to updating the `CompilerErrorDetailOptions` type in #34401. Updated the option to take in a `ErrorCategory` instead. --------- Co-authored-by: lauren --- compiler/apps/playground/components/Editor/EditorImpl.tsx | 4 ++-- compiler/packages/babel-plugin-react-compiler/src/index.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/apps/playground/components/Editor/EditorImpl.tsx b/compiler/apps/playground/components/Editor/EditorImpl.tsx index d7229361d3..0c12b482a3 100644 --- a/compiler/apps/playground/components/Editor/EditorImpl.tsx +++ b/compiler/apps/playground/components/Editor/EditorImpl.tsx @@ -13,7 +13,7 @@ import BabelPluginReactCompiler, { CompilerErrorDetail, CompilerDiagnostic, Effect, - ErrorSeverity, + ErrorCategory, parseConfigPragmaForTests, ValueKind, type Hook, @@ -258,7 +258,7 @@ function compile( console.error(err); error.details.push( new CompilerErrorDetail({ - severity: ErrorSeverity.Invariant, + category: ErrorCategory.Invariant, reason: `Unexpected failure when transforming input! ${err}`, loc: null, suggestions: null, diff --git a/compiler/packages/babel-plugin-react-compiler/src/index.ts b/compiler/packages/babel-plugin-react-compiler/src/index.ts index 2830d70d95..a8b934160a 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/index.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/index.ts @@ -12,6 +12,7 @@ export { CompilerDiagnostic, CompilerSuggestionOperation, ErrorSeverity, + ErrorCategory, LintRules, type CompilerErrorDetailOptions, type CompilerDiagnosticOptions,