<p dir="auto">I'm using the <a href="https://github.com/animatedjs/animated/">animated</a> inside a next.js app<br>
Thing work fine but when I try to build the app I'm having an issue</p>
<details>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ Error: ./~/animated/lib/targets/react-dom.js
Module not found: Error: Can't resolve 'react-dom/lib/CSSPropertyOperations' in '/Users/lionel/Code/lumographe/animated-next/node_modules/animated/lib/targets'
resolve 'react-dom/lib/CSSPropertyOperations' in '/Users/lionel/Code/lumographe/animated-next/node_modules/animated/lib/targets'
  Parsed request is a module
  using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
    Field 'browser' doesn't contain a valid alias configuration
    aliased with mapping 'react-dom': '/Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js' to '/Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations'
      using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
        using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/package.json (relative path: ./dist/react-dom.min.js/lib/CSSPropertyOperations)
          as directory
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations doesn't exist
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations.json doesn't exist
"><pre class="notranslate"><code class="notranslate">{ Error: ./~/animated/lib/targets/react-dom.js
Module not found: Error: Can't resolve 'react-dom/lib/CSSPropertyOperations' in '/Users/lionel/Code/lumographe/animated-next/node_modules/animated/lib/targets'
resolve 'react-dom/lib/CSSPropertyOperations' in '/Users/lionel/Code/lumographe/animated-next/node_modules/animated/lib/targets'
  Parsed request is a module
  using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
    Field 'browser' doesn't contain a valid alias configuration
    aliased with mapping 'react-dom': '/Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js' to '/Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations'
      using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/animated/package.json (relative path: ./lib/targets)
        using description file: /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/package.json (relative path: ./dist/react-dom.min.js/lib/CSSPropertyOperations)
          as directory
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations doesn't exist
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            /Users/lionel/Code/lumographe/animated-next/node_modules/react-dom/dist/react-dom.min.js/lib/CSSPropertyOperations.json doesn't exist

</code></pre></div>
</details>
<p dir="auto">I've made a small repo if you want to investigate more <a href="https://github.com/lionelB/-animated-next">https://github.com/lionelB/-animated-next</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Failed to build on /var/folders/ys/lmdgwcfx4vv8w60w68ztzdfm0000gn/T/e219bf14-76f7-492a-b13c-545576e427fb
{ Error: ./~/react-tap-event-plugin/src/injectTapEventPlugin.js
Module not found: Error: Can't resolve 'react-dom/lib/EventPluginHub' in '/Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/src'
resolve 'react-dom/lib/EventPluginHub' in '/Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/src'
  Parsed request is a module
  using description file: /Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/package.json (relative path: ./src)"><pre class="notranslate"><code class="notranslate">Failed to build on /var/folders/ys/lmdgwcfx4vv8w60w68ztzdfm0000gn/T/e219bf14-76f7-492a-b13c-545576e427fb
{ Error: ./~/react-tap-event-plugin/src/injectTapEventPlugin.js
Module not found: Error: Can't resolve 'react-dom/lib/EventPluginHub' in '/Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/src'
resolve 'react-dom/lib/EventPluginHub' in '/Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/src'
  Parsed request is a module
  using description file: /Users/tknipfer/Desktop/plate/node_modules/react-tap-event-plugin/package.json (relative path: ./src)
</code></pre></div>
<p dir="auto">Running into this when doing a build with the latest next release</p>
<p dir="auto"><strong>Note from maintainers:</strong></p>
<h2 dir="auto">Fix</h2>
<p dir="auto"><code class="notranslate">next.config.js</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module.exports = {
  webpack: function (c) {
    if (c.resolve.alias) {
      delete c.resolve.alias['react']
      delete c.resolve.alias['react-dom']
    }
    return c
  }
}"><pre class="notranslate"><code class="notranslate">module.exports = {
  webpack: function (c) {
    if (c.resolve.alias) {
      delete c.resolve.alias['react']
      delete c.resolve.alias['react-dom']
    }
    return c
  }
}
</code></pre></div>