[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>
This commit is contained in:
Eugene Choi 2025-09-08 15:06:54 -04:00 committed by GitHub
parent d4374b3ae3
commit 3d9d22cbdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import BabelPluginReactCompiler, {
CompilerErrorDetail, CompilerErrorDetail,
CompilerDiagnostic, CompilerDiagnostic,
Effect, Effect,
ErrorSeverity, ErrorCategory,
parseConfigPragmaForTests, parseConfigPragmaForTests,
ValueKind, ValueKind,
type Hook, type Hook,
@ -258,7 +258,7 @@ function compile(
console.error(err); console.error(err);
error.details.push( error.details.push(
new CompilerErrorDetail({ new CompilerErrorDetail({
severity: ErrorSeverity.Invariant, category: ErrorCategory.Invariant,
reason: `Unexpected failure when transforming input! ${err}`, reason: `Unexpected failure when transforming input! ${err}`,
loc: null, loc: null,
suggestions: null, suggestions: null,

View File

@ -12,6 +12,7 @@ export {
CompilerDiagnostic, CompilerDiagnostic,
CompilerSuggestionOperation, CompilerSuggestionOperation,
ErrorSeverity, ErrorSeverity,
ErrorCategory,
LintRules, LintRules,
type CompilerErrorDetailOptions, type CompilerErrorDetailOptions,
type CompilerDiagnosticOptions, type CompilerDiagnosticOptions,