fix(app): do not crash when the browser translates the page (#2624)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-09 01:24:14 +02:00
1 parent 044a2c101d
commit d729f641ff
83 files changed
+3774 -1080

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
language js
or {
`<$tag $attrs>$children</$tag>`,
`<>$children</>`
} where {
$children <: some $text where { $text <: JsxText(), $text <: r"(?s).*\S.*" },
or { $children <: some `<$el $elAttrs>$elChildren</$el>`, $children <: some `<$void $voidAttrs />` },
$text <: not within or {
`<Trans $transAttrs>$transChildren</Trans>`,
`<Plural $pluralAttrs>$pluralChildren</Plural>`,
`<Select $selectAttrs>$selectChildren</Select>`,
`<SelectOrdinal $ordinalAttrs>$ordinalChildren</SelectOrdinal>`
} ,
register_diagnostic(span=$text, message="Bare JSX text with an element sibling breaks under page translation. Chrome moves the text into a <font> wrapper, and React then inserts before or removes a node that is no longer a direct child, which throws NotFoundError. Collapse the children into a single string child, or wrap this text run in its own element so it is the sole child.", severity="error")
}