mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
@@ -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,
|
||||
|
||||
@@ -12,6 +12,7 @@ export {
|
||||
CompilerDiagnostic,
|
||||
CompilerSuggestionOperation,
|
||||
ErrorSeverity,
|
||||
ErrorCategory,
|
||||
LintRules,
|
||||
type CompilerErrorDetailOptions,
|
||||
type CompilerDiagnosticOptions,
|
||||
|
||||
Reference in New Issue
Block a user