Chrome's translation feature can crash or freeze React apps by detaching DOM nodes

When Chrome's built-in page translator runs, it replaces existing text nodes with new wrapped elements, leaving React's internal references pointing to detached, parentless nodes. This mismatch triggers an 'removeChild' error in some cases and a silent, unreported freeze in others, depending on how text nodes are structured in the component. A developer spent roughly a month testing multiple translation engines — including Chrome, Edge, Firefox, and Yandex — recording exactly how each one modifies the live DOM. The investigation found that Edge and Firefox rewrite text nodes in place, avoiding the detachment problem, while Chrome and Yandex replace them entirely with wrapper elements. Workarounds exist but carry trade-offs, such as brief flashes of untranslated text or broken grammar in morphologically complex languages like Russian.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in