[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,
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,

View File

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