From 84ed1f2a37cbe17975bd3691cb0e2a61d2a6285f Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Mon, 26 Feb 2024 15:08:42 -0800 Subject: [PATCH] Update scope declaration invariant to support error grouping This invariant interpolated values into the `reason` which prevent our internal tooling from grouping related errors. This PR updates to make the reason static and interpolate the description. --- .../src/ReactiveScopes/CodegenReactiveFunction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts b/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts index 75f5223b4b..d9c7ae1c44 100644 --- a/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts +++ b/compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts @@ -435,8 +435,8 @@ function codegenReactiveScope( ); if (testCondition === null) { CompilerError.invariant(firstOutputIndex !== null, { - reason: `Expected scope '@${scope.id}' to have at least one declaration`, - description: null, + reason: `Expected scope to have at least one declaration`, + description: `Scope '@{scope.id} has no declarations`, loc: null, suggestions: null, });