mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01: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:
parent
d4374b3ae3
commit
3d9d22cbdb
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export {
|
||||||
CompilerDiagnostic,
|
CompilerDiagnostic,
|
||||||
CompilerSuggestionOperation,
|
CompilerSuggestionOperation,
|
||||||
ErrorSeverity,
|
ErrorSeverity,
|
||||||
|
ErrorCategory,
|
||||||
LintRules,
|
LintRules,
|
||||||
type CompilerErrorDetailOptions,
|
type CompilerErrorDetailOptions,
|
||||||
type CompilerDiagnosticOptions,
|
type CompilerDiagnosticOptions,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user