[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 <poteto@users.noreply.github.com>
Eugene Choi committed
Sep 8, 2025 at 15:06 UTC
3d9d22cbdbfc1df2ec1d2ca00cb824e36af46ab8
2 files changed
+3
-2
compiler/apps/playground/components/Editor/EditorImpl.tsx
+2
-2
@@ -13,7 +13,7 @@ import BabelPluginReactCompiler, {
13
CompilerErrorDetail,
14
CompilerDiagnostic,
15
Effect,
16
- ErrorSeverity,
16
+ ErrorCategory,
17
parseConfigPragmaForTests,
18
ValueKind,
19
type Hook,
@@ -258,7 +258,7 @@ function compile(
258
console.error(err);
259
error.details.push(
260
new CompilerErrorDetail({
261
- severity: ErrorSeverity.Invariant,
261
+ category: ErrorCategory.Invariant,
262
reason: `Unexpected failure when transforming input! ${err}`,
263
loc: null,
264
suggestions: null,
compiler/packages/babel-plugin-react-compiler/src/index.ts
+1
@@ -12,6 +12,7 @@ export {
12
CompilerDiagnostic,
13
CompilerSuggestionOperation,
14
ErrorSeverity,
15
+ ErrorCategory,
16
LintRules,
17
type CompilerErrorDetailOptions,
18
type CompilerDiagnosticOptions,