mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Update hoisting error message to allow error aggregation
Interpolating values into the `reason` field of an error breaks our error aggregation. This PR moves the offending function name into the `description` field which isn't used for aggregation.
This commit is contained in:
@@ -646,9 +646,8 @@ function checkFunctionReferencedBeforeDeclarationAtTopLevel(
|
||||
if (scope === null) {
|
||||
errors.pushErrorDetail(
|
||||
new CompilerErrorDetail({
|
||||
reason: `Encountered ${fn.name} used before declaration which breaks Forget's gating codegen due to hoisting`,
|
||||
description:
|
||||
"Rewrite the reference to not use hoisting to fix this issue",
|
||||
reason: `Encountered a function used before its declaration, which breaks Forget's gating codegen due to hoisting`,
|
||||
description: `Rewrite the reference to ${fn.name} to not rely on hoisting to fix this issue`,
|
||||
loc: fn.loc ?? null,
|
||||
suggestions: null,
|
||||
severity: ErrorSeverity.Invariant,
|
||||
|
||||
Reference in New Issue
Block a user