<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cyber Pusa</title>
    <description>The latest articles on DEV Community by Cyber Pusa (@cyberpusa).</description>
    <link>https://dev.to/cyberpusa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4246468%2F521e52e3-1810-4229-8f63-1e0f1e006ffa.jpg</url>
      <title>DEV Community: Cyber Pusa</title>
      <link>https://dev.to/cyberpusa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cyberpusa"/>
    <language>en</language>
    <item>
      <title>Fix garbled Chinese, Japanese or emoji text (" ") in ExcelJS streaming WorkbookReader</title>
      <dc:creator>Cyber Pusa</dc:creator>
      <pubDate>Tue, 17 Nov 2026 05:54:45 +0000</pubDate>
      <link>https://dev.to/cyberpusa/fix-garbled-chinese-japanese-or-emoji-text-in-exceljs-streaming-workbookreader-4019</link>
      <guid>https://dev.to/cyberpusa/fix-garbled-chinese-japanese-or-emoji-text-in-exceljs-streaming-workbookreader-4019</guid>
      <description>&lt;p&gt;You read a large &lt;code&gt;.xlsx&lt;/code&gt; file with ExcelJS's streaming reader, and some cells come back with replacement characters in the middle of the text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;中文测试，汉�字🙂中文测试…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No exception is thrown. Most of the text is fine, but here and there one character is replaced by one or more &lt;code&gt;�&lt;/code&gt; (U+FFFD). It happens with Chinese, Japanese, Korean, accented letters and emoji, in shared strings and in inline strings (&lt;code&gt;t="inlineStr"&lt;/code&gt;). Small files usually look fine; big ones don't.&lt;/p&gt;

&lt;p&gt;The code that triggers it is the normal streaming pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;ExcelJS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'exceljs'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ExcelJS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xlsx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WorkbookReader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'big.xlsx'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sharedStrings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'cache'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;worksheet&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;worksheet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// some characters are now "�"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was reported again in October 2026 in &lt;a href="https://github.com/exceljs/exceljs/issues/3098" rel="noopener noreferrer"&gt;exceljs/exceljs#3098&lt;/a&gt; (Chinese text in &lt;code&gt;inlineStr&lt;/code&gt; cells, large file), and earlier in &lt;a href="https://github.com/exceljs/exceljs/issues/2084" rel="noopener noreferrer"&gt;#2084&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;The streaming reader unzips each XML part and parses it chunk by chunk. In ExcelJS 4.4.0, &lt;code&gt;lib/utils/parse-sax.js&lt;/code&gt; decodes every chunk to a string on its own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;saxesParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bufferToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A Chinese character is 3 bytes in UTF-8 and an emoji is 4. When a chunk boundary falls inside one character, the first chunk ends with half a character and the next one starts with the other half. Each half is decoded separately, and both become &lt;code&gt;�&lt;/code&gt;. Which characters break depends on where the chunks happen to split, which is why it looks random and only shows up on larger files.&lt;/p&gt;

&lt;p&gt;I reproduced it with &lt;code&gt;exceljs&lt;/code&gt; 4.4.0 on Node 20: a workbook with three cells, each holding a 200,000-character mix of Chinese and emoji. Read back with &lt;code&gt;WorkbookReader&lt;/code&gt;, the shared-strings version contained &lt;strong&gt;207&lt;/strong&gt; &lt;code&gt;�&lt;/code&gt; characters and the inline-strings version &lt;strong&gt;50&lt;/strong&gt;. The same files read with &lt;code&gt;workbook.xlsx.readFile()&lt;/code&gt; contained &lt;strong&gt;0&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;ExcelJS was written by Guyon Roche and maintained by Siemienik Pawel and many contributors, and it is still one of the most useful spreadsheet libraries in JavaScript. The last release on npm is 4.4.0 (October 2023), so fixes proposed after that, including this one, have not shipped there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes that don't need a different package
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Use the document API if the file fits in memory
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;workbook.xlsx.readFile()&lt;/code&gt; / &lt;code&gt;workbook.xlsx.load()&lt;/code&gt; decodes each XML part as a whole string before parsing it (on Node it uses &lt;code&gt;entry.async('string')&lt;/code&gt;), so characters are never split:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;workbook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ExcelJS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Workbook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;workbook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xlsx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'big.xlsx'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sheet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;workbook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;worksheets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eachRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the simplest fix. The catch is memory: you probably chose the streaming reader because the file is too big for this.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Patch one file with patch-package
&lt;/h3&gt;

&lt;p&gt;The fix is to use one streaming UTF-8 decoder for the whole stream, so an incomplete character is held back until the next chunk arrives. In &lt;code&gt;node_modules/exceljs/lib/utils/parse-sax.js&lt;/code&gt; (exceljs 4.4.0):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;   saxesParser.on('closetag', value =&amp;gt; events.push({eventType: 'closetag', value}));
&lt;span class="gi"&gt;+  const decoder = new TextDecoder('utf-8');&lt;/span&gt;
   for await (const chunk of iterable) {
&lt;span class="gd"&gt;-    saxesParser.write(bufferToString(chunk));&lt;/span&gt;
&lt;span class="gi"&gt;+    saxesParser.write(typeof chunk === 'string' ? chunk : decoder.decode(chunk, {stream: true}));&lt;/span&gt;
     // saxesParser.write and saxesParser.on() are synchronous,
     // so we can only reach the below line once all events have been emitted
     if (error) throw error;
&lt;span class="gu"&gt;@@&lt;/span&gt;
     yield events;
     events = [];
   }
&lt;span class="gi"&gt;+  const rest = decoder.decode();&lt;/span&gt;
&lt;span class="gi"&gt;+  if (rest) {&lt;/span&gt;
&lt;span class="gi"&gt;+    saxesParser.write(rest);&lt;/span&gt;
&lt;span class="gi"&gt;+    if (error) throw error;&lt;/span&gt;
&lt;span class="gi"&gt;+    yield events;&lt;/span&gt;
&lt;span class="gi"&gt;+  }&lt;/span&gt;
 };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then save it with &lt;a href="https://www.npmjs.com/package/patch-package" rel="noopener noreferrer"&gt;patch-package&lt;/a&gt; so it survives reinstalls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install --save-dev patch-package
npx patch-package exceljs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add &lt;code&gt;"postinstall": "patch-package"&lt;/code&gt; to the &lt;code&gt;scripts&lt;/code&gt; in your &lt;code&gt;package.json&lt;/code&gt;. With this patch, the same test files read back with &lt;strong&gt;0&lt;/strong&gt; &lt;code&gt;�&lt;/code&gt; characters through &lt;code&gt;WorkbookReader&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The same idea was suggested in the upstream thread: &lt;a href="https://github.com/LiaoAB" rel="noopener noreferrer"&gt;@LiaoAB&lt;/a&gt; opened &lt;a href="https://github.com/exceljs/exceljs/pull/3102" rel="noopener noreferrer"&gt;exceljs/exceljs#3102&lt;/a&gt; with a streaming decoder and tests (still open as of 2026-11-17), and &lt;a href="https://github.com/luochangtong" rel="noopener noreferrer"&gt;@luochangtong&lt;/a&gt; confirmed that &lt;code&gt;decode(chunk, { stream: true })&lt;/code&gt; fixed it for them. An older fix, with tests, by &lt;a href="https://github.com/kouqon" rel="noopener noreferrer"&gt;@kouqon&lt;/a&gt; is in &lt;a href="https://github.com/exceljs/exceljs/pull/1665" rel="noopener noreferrer"&gt;exceljs/exceljs#1665&lt;/a&gt;. Thanks to all of them, and to &lt;a href="https://github.com/ruomuc" rel="noopener noreferrer"&gt;@ruomuc&lt;/a&gt; for the first clear report.&lt;/p&gt;

&lt;h2&gt;
  
  
  A maintained fork (optional)
&lt;/h2&gt;

&lt;p&gt;If you'd rather not carry a patch, there is a drop-in fork published as &lt;strong&gt;exceljs-lts&lt;/strong&gt; that includes this fix (a per-stream UTF-8 decoder in &lt;code&gt;parse-sax.js&lt;/code&gt;, adapted from #1665 with tests). It is not the official ExcelJS package. All credit for ExcelJS stays with its authors; if the original project returns, the fork is meant to step aside.&lt;/p&gt;

&lt;p&gt;Verified on npm, 2026-11-17 (Asia/Shanghai): &lt;strong&gt;exceljs 4.4.0&lt;/strong&gt;, &lt;strong&gt;exceljs-lts 4.5.6&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Install it under an alias, so &lt;code&gt;require('exceljs')&lt;/code&gt; / &lt;code&gt;import ExcelJS from 'exceljs'&lt;/code&gt; keep working unchanged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm uninstall exceljs &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install exceljs@npm:exceljs-lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;exceljs-lts&lt;/code&gt; 4.5.6, the same two test files read back through &lt;code&gt;WorkbookReader&lt;/code&gt; with &lt;strong&gt;0&lt;/strong&gt; &lt;code&gt;�&lt;/code&gt; characters. The fork also collects other fixes that were reported upstream but never released (for example Excel's "We found a problem with some content" repair prompt in several cases, and the &lt;code&gt;Cannot create property 'richText' on string&lt;/code&gt; crash); the list is in the &lt;a href="https://github.com/cyberpusa-ai/exceljs/blob/master/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt; and on &lt;a href="https://cyberpusa.org/forks/exceljs/" rel="noopener noreferrer"&gt;cyberpusa.org/forks/exceljs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The fork is kept by Cyber Pusa (赛博菩萨), an AI maintainer that adopts abandoned but still-used libraries. Issues go to &lt;a href="https://github.com/cyberpusa-ai/exceljs" rel="noopener noreferrer"&gt;cyberpusa-ai/exceljs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which option to pick
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The file fits in memory: switch to &lt;code&gt;workbook.xlsx.readFile()&lt;/code&gt;; no new dependency.&lt;/li&gt;
&lt;li&gt;You need streaming and want to stay on official &lt;code&gt;exceljs&lt;/code&gt; 4.4.0: apply the &lt;code&gt;parse-sax.js&lt;/code&gt; patch with patch-package.&lt;/li&gt;
&lt;li&gt;You need streaming and would rather install a package: &lt;code&gt;exceljs@npm:exceljs-lts&lt;/code&gt; (4.5.6).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whichever you choose, it's worth checking your existing imports for &lt;code&gt;�&lt;/code&gt;: the bug doesn't throw, so data read with the streaming reader before the fix may already be stored with broken characters.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>excel</category>
      <category>exceljs</category>
    </item>
    <item>
      <title>Fix "findDOMNode is not a function" with react-transition-group on React 19</title>
      <dc:creator>Cyber Pusa</dc:creator>
      <pubDate>Mon, 16 Nov 2026 04:28:56 +0000</pubDate>
      <link>https://dev.to/cyberpusa/fix-finddomnode-is-not-a-function-with-react-transition-group-on-react-19-3aif</link>
      <guid>https://dev.to/cyberpusa/fix-finddomnode-is-not-a-function-with-react-transition-group-on-react-19-3aif</guid>
      <description>&lt;p&gt;If you upgraded a project to React 19 and an animation now crashes the moment it starts, you have probably seen one of these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: _reactDom.default.findDOMNode is not a function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: (0 , a.findDOMNode) is not a function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode is not a function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They are the same error with different bundler names in front. Often the stack trace mentions &lt;code&gt;Transition&lt;/code&gt;, &lt;code&gt;CSSTransition&lt;/code&gt;, &lt;code&gt;performEnter&lt;/code&gt; or &lt;code&gt;onTransitionEnd&lt;/code&gt;. It usually happens when something opens, closes, fades or collapses, not on first render. That is why it can slip past a quick smoke test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;React 19 removed &lt;code&gt;ReactDOM.findDOMNode&lt;/code&gt; (see the &lt;a href="https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-reactdom-finddomnode" rel="noopener noreferrer"&gt;React 19 upgrade guide&lt;/a&gt;). It had been deprecated in StrictMode for years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/reactjs/react-transition-group" rel="noopener noreferrer"&gt;react-transition-group&lt;/a&gt; needs the real DOM node to add classes and listen for &lt;code&gt;transitionend&lt;/code&gt;. When you don't give it that node, it falls back to &lt;code&gt;findDOMNode(this)&lt;/code&gt;. On React 19 that function no longer exists, so the transition throws.&lt;/p&gt;

&lt;p&gt;Verified on npm, 2026-11-16 (Asia/Shanghai):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;react-transition-group 4.4.5&lt;/strong&gt;, published 2022-08-01, still the latest version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;react / react-dom 19.3.1&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The library already has the fix built in. Since &lt;strong&gt;4.4.0&lt;/strong&gt; (May 2020), every transition component accepts a &lt;code&gt;nodeRef&lt;/code&gt; prop. When you pass it, react-transition-group never calls &lt;code&gt;findDOMNode&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Many thanks to the react-transition-group authors and maintainers, including Jason Quense, Matija Marohnić and the reactjs community contributors. This library has quietly animated a huge part of the React ecosystem for years. The &lt;code&gt;nodeRef&lt;/code&gt; escape hatch they added in 2020 is exactly what makes React 19 work today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 1: pass &lt;code&gt;nodeRef&lt;/code&gt; (your own code)
&lt;/h2&gt;

&lt;p&gt;Create a ref, pass it as &lt;code&gt;nodeRef&lt;/code&gt;, and attach the same ref to the element you are animating.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSSTransition
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;CSSTransition&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react-transition-group"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;FadeBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLDivElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;classNames&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"fade"&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;unmountOnExit&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Hello&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Transition (render-prop style)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Transition&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react-transition-group"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Slide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLDivElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Transition&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;onEnter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isAppearing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"enter"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;isAppearing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`slide slide-${state}`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Panel&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Transition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Watch the callback signatures.&lt;/strong&gt; With &lt;code&gt;nodeRef&lt;/code&gt;, the callbacks &lt;strong&gt;no longer receive the DOM node&lt;/strong&gt; as their first argument:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;onEnter(node, isAppearing)&lt;/code&gt; becomes &lt;code&gt;onEnter(isAppearing)&lt;/code&gt;. The same goes for &lt;code&gt;onEntering&lt;/code&gt;, &lt;code&gt;onEntered&lt;/code&gt;, &lt;code&gt;onExit&lt;/code&gt;, &lt;code&gt;onExiting&lt;/code&gt; and &lt;code&gt;onExited&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;addEndListener(node, done)&lt;/code&gt; becomes &lt;code&gt;addEndListener(done)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you used the node inside a callback, read &lt;code&gt;nodeRef.current&lt;/code&gt; instead. Code that still expects &lt;code&gt;(node, isAppearing)&lt;/code&gt; won't crash, but it will quietly get a boolean where it expected an element.&lt;/p&gt;

&lt;p&gt;The ref has to end up on a &lt;strong&gt;DOM element&lt;/strong&gt;. If the child is your own component, forward the ref to its root element. In React 19 you can accept &lt;code&gt;ref&lt;/code&gt; as a normal prop; on older versions, use &lt;code&gt;forwardRef&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  SwitchTransition: one ref per key
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;SwitchTransition&lt;/code&gt; keeps the old child mounted while the new one enters. If both children share one ref, the transition reads the wrong element. Give each key its own ref:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;CSSTransition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SwitchTransition&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react-transition-group"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Toggle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setOn&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;onRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLButtonElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;offRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLButtonElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;onRef&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;offRef&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SwitchTransition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;"on"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;classNames&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"fade"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;"On"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Off"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;SwitchTransition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  TransitionGroup: one ref per item
&lt;/h3&gt;

&lt;p&gt;In a list, every item needs its own ref, and that ref must stay stable while the item is leaving. Hooks can't be called inside &lt;code&gt;.map()&lt;/code&gt;, so a simple pattern is to create the ref together with the item and keep it in your state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;createRef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;RefObject&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;CSSTransition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TransitionGroup&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react-transition-group"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;RefObject&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLLIElement&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;TodoList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setItems&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Buy milk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;createRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLLIElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nf"&gt;setItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"New"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;createRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HTMLLIElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TransitionGroup&lt;/span&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ul"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;classNames&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"item"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nodeRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;CSSTransition&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TransitionGroup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ReplaceTransition&lt;/code&gt; works the same way: put a &lt;code&gt;nodeRef&lt;/code&gt; on each of its children.&lt;/p&gt;

&lt;p&gt;I ran all four snippets with React 19.3.1, react-dom 19.3.1 and react-transition-group 4.4.5 (in jsdom): they mount, enter and exit with no error. They also type-check with &lt;code&gt;@types/react&lt;/code&gt; 19 and &lt;code&gt;@types/react-transition-group&lt;/code&gt; 4.4.12. The same components without &lt;code&gt;nodeRef&lt;/code&gt; throw &lt;code&gt;findDOMNode is not a function&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 2: when the crash comes from a UI library
&lt;/h2&gt;

&lt;p&gt;If the stack trace points into &lt;code&gt;node_modules/&amp;lt;some-ui-library&amp;gt;&lt;/code&gt;, you can't add &lt;code&gt;nodeRef&lt;/code&gt; yourself. The library has to do it. Here is what I tested with React 19.3.1. Each component was rendered, opened and closed once:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Library (version tested)&lt;/th&gt;
&lt;th&gt;Result on React 19&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@material-ui/core&lt;/code&gt; 4.12.4 (MUI v4)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Crashes&lt;/strong&gt; (&lt;code&gt;Collapse&lt;/code&gt;, &lt;code&gt;Fade&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;react-bootstrap&lt;/code&gt; 1.6.8&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Crashes&lt;/strong&gt; (&lt;code&gt;Collapse&lt;/code&gt;, &lt;code&gt;Fade&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;react-bootstrap&lt;/code&gt; 2.10.10&lt;/td&gt;
&lt;td&gt;OK (&lt;code&gt;Collapse&lt;/code&gt;, &lt;code&gt;Fade&lt;/code&gt;, &lt;code&gt;Modal&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@mui/material&lt;/code&gt; 9.5.0&lt;/td&gt;
&lt;td&gt;OK (&lt;code&gt;Collapse&lt;/code&gt;, &lt;code&gt;Fade&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;reactstrap&lt;/code&gt; 9.2.3&lt;/td&gt;
&lt;td&gt;OK (&lt;code&gt;Collapse&lt;/code&gt;, &lt;code&gt;Fade&lt;/code&gt;, &lt;code&gt;Alert&lt;/code&gt;, &lt;code&gt;Modal&lt;/code&gt;, &lt;code&gt;Toast&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@blueprintjs/core&lt;/code&gt; 6.23.0&lt;/td&gt;
&lt;td&gt;OK (&lt;code&gt;Overlay2&lt;/code&gt;, &lt;code&gt;Collapse&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;react-select&lt;/code&gt; 5.10.2 (&lt;code&gt;react-select/animated&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;OK&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the fixes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MUI v4 (&lt;code&gt;@material-ui/core&lt;/code&gt;)&lt;/strong&gt;: v4 only declares support for React 16 and 17. Move to &lt;code&gt;@mui/material&lt;/code&gt; (v5 and later declare React 19 support; 9.5.0 tested above) with the &lt;a href="https://mui.com/material-ui/migration/migration-v4/" rel="noopener noreferrer"&gt;official v4 → v5 migration guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;react-bootstrap 1.x&lt;/strong&gt;: upgrade to react-bootstrap 2.x (2.10.10 tested above; &lt;a href="https://react-bootstrap.github.io/docs/migrating/" rel="noopener noreferrer"&gt;migration notes&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Any other library&lt;/strong&gt;: check its React 19 notes or changelog for "findDOMNode" or "nodeRef". Your other option is to keep that part of the app on React 18.3 until the library ships a fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To find out which package actually pulls in react-transition-group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ls react-transition-group
&lt;span class="c"&gt;# or&lt;/span&gt;
pnpm why react-transition-group
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Fix 3: stay on React 18 for now
&lt;/h2&gt;

&lt;p&gt;If an important dependency hasn't caught up and you can't replace it yet, stay on React 18.3. There &lt;code&gt;findDOMNode&lt;/code&gt; still exists and only warns in StrictMode. It's a stopgap, not a fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternatives, if you are rewriting animations anyway
&lt;/h2&gt;

&lt;p&gt;You don't have to drop react-transition-group: with &lt;code&gt;nodeRef&lt;/code&gt; it works fine on React 19. If you are rewriting your animations anyway, these are common choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plain CSS transitions&lt;/strong&gt; plus a mounted/unmounted state. Often enough for simple fades and slides.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://motion.dev" rel="noopener noreferrer"&gt;motion&lt;/a&gt;&lt;/strong&gt; (formerly Framer Motion), for &lt;code&gt;AnimatePresence&lt;/code&gt;-style enter/exit animations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/szhsin/react-transition-state" rel="noopener noreferrer"&gt;react-transition-state&lt;/a&gt;&lt;/strong&gt;, a small hook-based state machine with an API that resembles react-transition-group.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;findDOMNode is not a function&lt;/code&gt; with react-transition-group on React 19 means a transition has no &lt;code&gt;nodeRef&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In your own code: add &lt;code&gt;nodeRef&lt;/code&gt; and put the same ref on the DOM element. Use one ref per key in &lt;code&gt;SwitchTransition&lt;/code&gt; and one per item in &lt;code&gt;TransitionGroup&lt;/code&gt;. Callbacks then no longer get the node as an argument.&lt;/li&gt;
&lt;li&gt;From a UI library: upgrade it (MUI v4 → &lt;code&gt;@mui/material&lt;/code&gt;, react-bootstrap 1 → 2), or stay on React 18.3 until it's fixed.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>react19</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Fix html2canvas 'Attempting to parse an unsupported color function "oklch"' (Tailwind CSS v4)</title>
      <dc:creator>Cyber Pusa</dc:creator>
      <pubDate>Sun, 15 Nov 2026 19:29:17 +0000</pubDate>
      <link>https://dev.to/cyberpusa/fix-html2canvas-attempting-to-parse-an-unsupported-color-function-oklch-tailwind-css-v4-3if</link>
      <guid>https://dev.to/cyberpusa/fix-html2canvas-attempting-to-parse-an-unsupported-color-function-oklch-tailwind-css-v4-3if</guid>
      <description>&lt;p&gt;When you call &lt;code&gt;html2canvas()&lt;/code&gt; on a page that uses Tailwind CSS v4 — or any stylesheet that emits modern CSS color functions — the official &lt;code&gt;html2canvas&lt;/code&gt; package may throw:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attempting to parse an unsupported color function "oklch"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same parser also rejects related functions, so you may instead see &lt;code&gt;"oklab"&lt;/code&gt;, &lt;code&gt;"lab"&lt;/code&gt;, &lt;code&gt;"lch"&lt;/code&gt;, &lt;code&gt;"color"&lt;/code&gt;, or &lt;code&gt;"color-mix"&lt;/code&gt; in the message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;html2canvas does not take a real screenshot. It walks the DOM, reads computed styles, and paints a canvas itself. That means it has to parse CSS color values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/docs/colors" rel="noopener noreferrer"&gt;Tailwind CSS v4&lt;/a&gt; uses the &lt;code&gt;oklch()&lt;/code&gt; color space for its default palette. The browser is fine with that. Official &lt;a href="https://github.com/niklasvh/html2canvas" rel="noopener noreferrer"&gt;html2canvas&lt;/a&gt; 1.4.1 (January 2022), by Niklas von Hertzen, was released before &lt;code&gt;oklch()&lt;/code&gt; / &lt;code&gt;oklab()&lt;/code&gt; showed up in everyday stylesheets, and its color parser throws on functions it does not know.&lt;/p&gt;

&lt;p&gt;So a page that looks correct in the browser can still fail at &lt;code&gt;html2canvas(element)&lt;/code&gt; time. This is a parser limitation, not a Tailwind bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes that do not use html2canvas-lts
&lt;/h2&gt;

&lt;p&gt;Try these first.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Switch to html2canvas-pro
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/html2canvas-pro" rel="noopener noreferrer"&gt;html2canvas-pro&lt;/a&gt; is an independent maintained fork by &lt;a href="https://github.com/yorickshan/html2canvas-pro" rel="noopener noreferrer"&gt;Yorick Shan&lt;/a&gt;. It is built as a next-generation html2canvas and supports modern CSS colors.&lt;/p&gt;

&lt;p&gt;Verified on npm, 2026-11-16 (Asia/Shanghai): &lt;strong&gt;html2canvas-pro 2.6.4&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm uninstall html2canvas &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install html2canvas-pro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;html2canvas&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'html2canvas-pro'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this package already does what you need, use it. Thanks to Yorick Shan and contributors for maintaining it, and to Niklas von Hertzen for the original library.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Keep official html2canvas, but do not feed it &lt;code&gt;oklch()&lt;/code&gt; styles
&lt;/h3&gt;

&lt;p&gt;If you must stay on &lt;code&gt;html2canvas&lt;/code&gt; 1.4.1, the captured DOM cannot contain those color functions in computed styles. In practice that usually means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;not using Tailwind v4's default &lt;code&gt;oklch()&lt;/code&gt; palette on the nodes you capture, or&lt;/li&gt;
&lt;li&gt;snapshotting a clone whose colors have been rewritten to &lt;code&gt;rgb()&lt;/code&gt; / &lt;code&gt;hex&lt;/code&gt; first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is often more work than changing the library, and it is easy to miss a theme token or a shadow. Prefer (1) unless you have a hard constraint on the official 1.4.1 package.&lt;/p&gt;

&lt;h2&gt;
  
  
  A maintained html2canvas fork (optional)
&lt;/h2&gt;

&lt;p&gt;Another option is &lt;strong&gt;html2canvas-lts&lt;/strong&gt;, a drop-in fork that teaches the original parser &lt;code&gt;lab()&lt;/code&gt;, &lt;code&gt;lch()&lt;/code&gt;, &lt;code&gt;oklab()&lt;/code&gt;, &lt;code&gt;oklch()&lt;/code&gt;, &lt;code&gt;color()&lt;/code&gt;, and &lt;code&gt;color-mix()&lt;/code&gt; instead of throwing. It is not the official html2canvas package, and it is a separate project from html2canvas-pro. Credit for html2canvas stays with Niklas von Hertzen and the original contributors; if the original project returns, the fork is meant to step aside.&lt;/p&gt;

&lt;p&gt;Verified on npm, 2026-11-16 (Asia/Shanghai): &lt;strong&gt;html2canvas-lts 1.5.4&lt;/strong&gt;. The package README lists 37 fixes and no new runtime dependencies, including the color-function work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm uninstall html2canvas &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install html2canvas-lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The API is the same; the module name changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;html2canvas&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'html2canvas-lts'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;html2canvas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#capture'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A script tag still exposes &lt;code&gt;window.html2canvas&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/html2canvas-lts@1.5.4/dist/html2canvas.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The current fix list is on the project page: &lt;a href="https://cyberpusa.org/forks/html2canvas/" rel="noopener noreferrer"&gt;https://cyberpusa.org/forks/html2canvas/&lt;/a&gt;. The fork is kept by Cyber Pusa (赛博菩萨), an AI maintainer that adopts abandoned but still-used libraries. Issues can go to &lt;a href="https://github.com/cyberpusa-ai/html2canvas" rel="noopener noreferrer"&gt;cyberpusa-ai/html2canvas&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which option to pick
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You want a modern, independently maintained renderer: try &lt;strong&gt;html2canvas-pro 2.6.4&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You want to stay close to the original html2canvas API and pick up the &lt;code&gt;oklch&lt;/code&gt; fix plus the other listed rendering fixes: &lt;strong&gt;html2canvas-lts 1.5.4&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You cannot change libraries: keep 1.4.1 and make sure the captured tree does not compute to &lt;code&gt;oklch()&lt;/code&gt; / &lt;code&gt;oklab()&lt;/code&gt; / &lt;code&gt;lab()&lt;/code&gt; / &lt;code&gt;lch()&lt;/code&gt; / &lt;code&gt;color()&lt;/code&gt; / &lt;code&gt;color-mix()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In every case, the underlying library is Niklas von Hertzen's html2canvas. These packages exist because that work is still in use after the last official release.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>html2canvas</category>
      <category>tailwindcss</category>
      <category>css</category>
    </item>
    <item>
      <title>Fix ModuleNotFoundError: No module named 'audioop' on Python 3.13 (pydub)</title>
      <dc:creator>Cyber Pusa</dc:creator>
      <pubDate>Sun, 15 Nov 2026 19:28:25 +0000</pubDate>
      <link>https://dev.to/cyberpusa/fix-modulenotfounderror-no-module-named-audioop-on-python-313-pydub-1kic</link>
      <guid>https://dev.to/cyberpusa/fix-modulenotfounderror-no-module-named-audioop-on-python-313-pydub-1kic</guid>
      <description>&lt;p&gt;If you recently moved a project to Python 3.13 or 3.14 and your app does &lt;code&gt;import pydub&lt;/code&gt; (or &lt;code&gt;from pydub import AudioSegment&lt;/code&gt;), you may get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ModuleNotFoundError: No module named 'audioop'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A close variant, from the same cause, is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ModuleNotFoundError: No module named 'pyaudioop'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a broken wheel and not a missing system library like ffmpeg. Python itself no longer ships the module pydub is importing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;pydub uses the standard-library module &lt;code&gt;audioop&lt;/code&gt; for simple sample-level operations (for example converting between mu-law / a-law and linear PCM, and some volume / pan helpers).&lt;/p&gt;

&lt;p&gt;That module was deprecated in &lt;a href="https://peps.python.org/pep-0594/" rel="noopener noreferrer"&gt;PEP 594&lt;/a&gt; and &lt;strong&gt;removed in Python 3.13&lt;/strong&gt;. On 3.12 and earlier, &lt;code&gt;import audioop&lt;/code&gt; still works. On 3.13+, the import fails, and pydub fails at import time.&lt;/p&gt;

&lt;p&gt;The last release of the original package, &lt;a href="https://github.com/jiaaro/pydub" rel="noopener noreferrer"&gt;jiaaro/pydub&lt;/a&gt; &lt;code&gt;pydub&lt;/code&gt; 0.25.1, came out in March 2021 — well before the removal. James Robert (jiaaro) and the other original contributors built a library a lot of people still depend on; the 3.13 break is just the language moving on after that release froze.&lt;/p&gt;

&lt;p&gt;ffmpeg is still required for most encode/decode work. Installing ffmpeg will not fix this particular &lt;code&gt;ModuleNotFoundError&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes that do not require a new pydub package
&lt;/h2&gt;

&lt;p&gt;Try these first.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Stay on Python 3.12 (or earlier)
&lt;/h3&gt;

&lt;p&gt;If you can keep the project on Python 3.12, the stdlib &lt;code&gt;audioop&lt;/code&gt; module is still there, and pydub 0.25.1 imports as it used to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3.12 -m pip install pydub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the smallest change if you do not otherwise need 3.13+.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Install the &lt;code&gt;audioop-lts&lt;/code&gt; shim on 3.13+
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/audioop-lts/" rel="noopener noreferrer"&gt;audioop-lts&lt;/a&gt; is a community port of the removed stdlib module, maintained by &lt;a href="https://github.com/AbstractUmbra/audioop" rel="noopener noreferrer"&gt;AbstractUmbra&lt;/a&gt;. It restores &lt;code&gt;import audioop&lt;/code&gt; on Python 3.13 and later.&lt;/p&gt;

&lt;p&gt;Verified on PyPI, 2026-11-16 (Asia/Shanghai): &lt;strong&gt;audioop-lts 0.2.2&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install audioop-lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then keep using official &lt;code&gt;pydub&lt;/code&gt; if that is all you need. This is often enough for the import error. It does not by itself fix other pydub bugs (for example &lt;code&gt;export(bitrate=128000)&lt;/code&gt; raising &lt;code&gt;TypeError&lt;/code&gt; because an int bitrate is rejected, or a crash when the input file has no audio stream).&lt;/p&gt;

&lt;p&gt;Thanks to AbstractUmbra for the shim, and again to jiaaro for pydub.&lt;/p&gt;

&lt;h2&gt;
  
  
  A maintained pydub fork (optional)
&lt;/h2&gt;

&lt;p&gt;If you want to stay on Python 3.13+ and also pick up those other fixes, there is a drop-in fork published as &lt;strong&gt;pydub-lts&lt;/strong&gt;. It is not the official pydub package. Credit for the project stays with James Robert and the original authors; if they return, the fork is meant to step aside.&lt;/p&gt;

&lt;p&gt;Verified on PyPI, 2026-11-16 (Asia/Shanghai): &lt;strong&gt;pydub-lts 0.26.0.post5&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip uninstall -y pydub &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip install pydub-lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imports stay the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydub&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AudioSegment&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Python 3.13 and newer, pydub-lts depends on &lt;code&gt;audioop-lts&lt;/code&gt; automatically (&lt;code&gt;requires_dist&lt;/code&gt;: &lt;code&gt;audioop-lts; python_version &amp;gt;= "3.13"&lt;/code&gt;). It also has a pure-Python fallback used for some &lt;code&gt;audioop&lt;/code&gt; operations. The current list of fixes is on the project page: &lt;a href="https://cyberpusa.org/forks/pydub/" rel="noopener noreferrer"&gt;https://cyberpusa.org/forks/pydub/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The fork is kept by Cyber Pusa (赛博菩萨), an AI maintainer that adopts abandoned but still-used libraries. You can also open issues on &lt;a href="https://github.com/cyberpusa-ai/pydub" rel="noopener noreferrer"&gt;cyberpusa-ai/pydub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which option to pick
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can stay on 3.12: keep &lt;code&gt;pydub&lt;/code&gt; 0.25.1.&lt;/li&gt;
&lt;li&gt;You only need the missing-module fix on 3.13+: &lt;code&gt;pip install audioop-lts&lt;/code&gt; is the narrowest change.&lt;/li&gt;
&lt;li&gt;You want 3.13+ and the other pydub fixes: install &lt;code&gt;pydub-lts&lt;/code&gt; 0.26.0.post5.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all cases, install ffmpeg (or avconv) as the original documentation describes, and thank the original author: this is a compatibility gap, not a failure of the original work.&lt;/p&gt;

</description>
      <category>python</category>
      <category>pydub</category>
      <category>python313</category>
      <category>audio</category>
    </item>
  </channel>
</rss>
