title: Rollup Error: 'default' is not exported by node_modules/react/index.js
body: <p>I have a project where I use webpack and want to switch to rollup.js but I have trouble regarding the plugin @rollup/plugin-commonjs.</p>
  <h2>My rollup.conf.js</h2>
  <pre class="lang-js prettyprint-override"><code>import resolve from '@rollup/plugin-node-resolve';
  import commonjs from '@rollup/plugin-commonjs';
  import babel from 'rollup-plugin-babel';
  import { terser } from 'rollup-plugin-terser';
  import nodePolyfills from 'rollup-plugin-node-polyfills';
  
  const config = {
      input: 'site/templates/scripts/master.js',
      output: [
          {
              file: 'site/templates/scripts/master.min.js',
              format: 'cjs'
          }
      ],
      plugins: [
          nodePolyfills(),
          resolve({
              browser: true
          }),
          commonjs({
              include: /node_modules/,
              namedExports: {
                  'react': [&quot;useState&quot;, &quot;useEffect&quot;],
                  '@apollo/client': ['ApolloProvider', 'ApolloClient', 'HttpLink', 'InMemoryCache', 'useQuery', 'gql'],
                  'styled-components': [ 'styled', 'css', 'ThemeProvider' ]
              }
          }),
          babel({
              babelrc: true,
              exclude: 'node_modules/**'
          }),
          terser()
      ]
  };
  
  export default config;
  </code></pre>
  <h2>The Error I'm getting and don't know to solve</h2>
  <pre class="lang-sh prettyprint-override"><code>site/templates/scripts/master.js → site/templates/scripts/master.min.js...
  [!] Error: 'default' is not exported by node_modules/react/index.js, imported by site/templates/scripts/src/BgProductRecommendations/FredhopperProduct.js
  https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
  site/templates/scripts/src/BgProductRecommendations/FredhopperProduct.js (3:7)
  1: 'use strict';
  2: 
  3: import React from &quot;react&quot;;
            ^
  4: 
  5: const FredhopperProduct = ({
  Error: 'default' is not exported by node_modules/react/index.js, imported by site/templates/scripts/src/BgProductRecommendations/FredhopperProduct.js
      at error (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:10152:30)
      at Module.error (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:14487:16)
      at handleMissingExport (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:14388:28)
      at Module.traceVariable (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:14871:24)
      at ModuleScope.findVariable (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:13448:39)
      at FunctionScope.findVariable (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:8661:38)
      at ChildScope.findVariable (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:8661:38)
      at MemberExpression.bind (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:11285:49)
      at CallExpression$1.bind (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:8746:23)
      at CallExpression$1.bind (/usr/local/lib/node_modules/rollup/dist/shared/rollup.js:11473:15)
  </code></pre>
  <p>The <a href="https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module" rel="noreferrer">https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module</a> page does not really help, since I have all named exports which I use in my config.</p>