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.
Joe Savona committed
Feb 26, 2024 at 15:08 UTC
84ed1f2a37cbe17975bd3691cb0e2a61d2a6285f
1 file changed
+2
-2
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts
+2
-2
@@ -435,8 +435,8 @@ function codegenReactiveScope(
435
);
436
if (testCondition === null) {
437
CompilerError.invariant(firstOutputIndex !== null, {
438
- reason: `Expected scope '@${scope.id}' to have at least one declaration`,
439
- description: null,
438
+ reason: `Expected scope to have at least one declaration`,
439
+ description: `Scope '@{scope.id} has no declarations`,
440
loc: null,
441
suggestions: null,
442
});