title: create-react-app integrate with storybook 6.1.6 and build has error
body: <p>create-react-app version</p>
  <pre><code>react: v17.0.1
  react-scripts: v4.0.1 
  </code></pre>
  <p>storybook version</p>
  <pre><code>@storybook/react: v6.1.6
  @storybook/addon-docs: v6.1.6
  @storybook/core: v6.1.6
  </code></pre>
  <p>and i could run <code>yarn start</code> to run react app and could run <code>start-storybook -p 9009 -s public</code> to start storybook.</p>
  <p>when it comes to build react app , it comes issue. look below.</p>
  <ol>
  <li>when run &quot;yarn run build&quot;, it actually run <code>react-app-rewired start</code>.</li>
  <li>it shows below</li>
  </ol>
  <pre><code>There might be a problem with the project dependency tree.
  It is likely not a bug in Create React App, but something you need to fix locally.
  
  The react-scripts package provided by Create React App requires a dependency:
  
    &quot;babel-loader&quot;: &quot;8.1.0&quot;
  
  Don't try to install it manually: your package manager does it automatically.
  However, a different version of babel-loader was detected higher up in the tree:
  
    /Users/yejinlei/Documents/playground/personal/react-temp/node_modules/babel-loader (version: 8.2.1) 
  
  Manually installing incompatible versions is known to cause hard-to-debug issues.
  
  If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
  That will permanently disable this message but you might encounter other issues.
  
  To fix the dependency tree, try following the steps below in the exact order:
  
    1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
    2. Delete node_modules in your project folder.
    3. Remove &quot;babel-loader&quot; from dependencies and/or devDependencies in the package.json file in your project folder.
    4. Run npm install or yarn, depending on the package manager you use.
  
  In most cases, this should be enough to fix the problem.
  If this has not helped, there are a few other things you can try:
  
    5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
       This may help because npm has known issues with package hoisting which may get resolved in future versions.
  
    6. Check if /Users/yejinlei/Documents/playground/personal/react-temp/node_modules/babel-loader is outside your project directory.
       For example, you might have accidentally installed something in your home folder.
  
    7. Try running npm ls babel-loader in your project folder.
       This will tell you which other package (apart from the expected react-scripts) installed babel-loader.
  
  If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
  That would permanently disable this preflight check in case you want to proceed anyway.
  
  P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
  </code></pre>
  <p>I run <code>npm ls babel-loader</code> and see below show</p>
  <pre><code>react-temp@0.1.0 /Users/yejinlei/Documents/playground/personal/react-temp
  ├─┬ @storybook/addon-docs@6.1.6
  │ └─┬ @storybook/core@6.1.6
  │   └── babel-loader@8.2.1  deduped
  └── babel-loader@8.2.1 
  </code></pre>
  <ol start="3">
  <li>and i follow the instruction and run <code>yarn add babel-loader@8.1.0</code>. when it done i get below :</li>
  </ol>
  <pre><code>react-temp@0.1.0 /Users/yejinlei/Documents/playground/personal/react-temp
  ├─┬ @storybook/addon-docs@6.1.6
  │ └─┬ @storybook/core@6.1.6
  │   └── babel-loader@8.2.1 
  └── babel-loader@8.1.0 
  </code></pre>
  <ol start="4">
  <li>then run <code>yarn run build</code>, which actually run <code>react-app-rewired build</code> and get below error</li>
  </ol>
  <pre><code>playground/personal/react-temp/node_modules/react-scripts/scripts/build.js:19
    throw err;
    ^
  
  TypeError: aGeneratedCode.split is not a function
      at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (playground/personal/react-temp/node_modules/source-map/lib/source-node.js:64:41)
  </code></pre>
  <p>can not build</p>
  <p>so then i target to the code <code>node_modules/source-map/lib/source-node.js</code></p>
  <p>and see the error code:</p>
  <pre><code>/node_modules/source-map/lib/source-node.js
  
  64 var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  
  </code></pre>
  <p>I run and analysis the code. the the aGeneratedCode will be &quot;obejct&quot;, so i change the code as below.</p>
  <pre><code>    var remainingLines = typeof(aGeneratedCode) === &quot;string&quot; ? aGeneratedCode.split(REGEX_NEWLINE) : [];
  </code></pre>
  <p>then i could run build / start of the cra app and storybook now.</p>
  <p>but why and how to permantly fix it ?</p>