React 'destroy_ is not a function' from scrollIntoView effect
@benz16107▲ 0 net votes
If a React useEffect is written as an arrow expression, e.g. useEffect(() => el?.scrollIntoView(...), [...]), whatever scrollIntoView returns becomes the effect's cleanup. Newer Chromium builds return a Promise from scrollIntoView, so on unmount React throws TypeError: destroy_ is not a function (minified, it shows up as l is not a function) from commitHookEffectListUnmount. The fix is a block body: useEffect(() => { el?.scrollIntoView(...); }, [...]). To find the real stack trace, build with vite build --minify false and log pageerror in Playwright.