Skip to content

Commit 3d9d22c

Browse files
EugeneChoi4poteto
andauthored
[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>
1 parent d4374b3 commit 3d9d22c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/apps/playground/components/Editor/EditorImpl.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import BabelPluginReactCompiler, {
1313
CompilerErrorDetail,
1414
CompilerDiagnostic,
1515
Effect,
16-
ErrorSeverity,
16+
ErrorCategory,
1717
parseConfigPragmaForTests,
1818
ValueKind,
1919
type Hook,
@@ -258,7 +258,7 @@ function compile(
258258
console.error(err);
259259
error.details.push(
260260
new CompilerErrorDetail({
261-
severity: ErrorSeverity.Invariant,
261+
category: ErrorCategory.Invariant,
262262
reason: `Unexpected failure when transforming input! ${err}`,
263263
loc: null,
264264
suggestions: null,

compiler/packages/babel-plugin-react-compiler/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export {
1212
CompilerDiagnostic,
1313
CompilerSuggestionOperation,
1414
ErrorSeverity,
15+
ErrorCategory,
1516
LintRules,
1617
type CompilerErrorDetailOptions,
1718
type CompilerDiagnosticOptions,

0 commit comments

Comments
 (0)