Repository: create-react-app
Issue: Invalid string length error thrown
Labels: issue: needs investigation

<!--
  PLEASE READ THE FIRST SECTION :-)
-->

### Is this a bug report?

Yes

After running `react-script` for a while, I get an exception thrown with the stacktrace:
```
/Users/will/Code/collect/node_modules/webpack/lib/Stats.js:221
                                        text += `\n @ ${current.readableIdentifier(requestShortener)}`;
                                                                ^

RangeError: Invalid string length
    at formatError (/Users/will/Code/collect/node_modules/webpack/lib/Stats.js:221:30)
    at Array.map (<anonymous>)
    at Stats.toJson (/Users/will/Code/collect/node_modules/webpack/lib/Stats.js:229:56)
    at Compiler.<anonymous> (/Users/will/Code/collect/node_modules/html-webpack-plugin/index.js:68:44)
    at Compiler.applyPluginsAsyncSeries (/Users/will/Code/collect/node_modules/tapable/lib/Tapable.js:206:13)
    at Compiler.emitAssets (/Users/will/Code/collect/node_modules/webpack/lib/C
```

### Did you try recovering your dependencies?

<!--
  Your module tree might be corrupted, and that might be causing the issues.
  Let's try to recover it. First, delete these files and folders in your project:

    * node_modules
    * package-lock.json
    * yarn.lock

  Then you need to decide which package manager you prefer to use.
  We support both npm (https://npmjs.com) and yarn (http://yarnpkg.com/).
  However, **they can't be used together in one project** so you need to pick one.
  
  If you decided to use npm, run this in your project directory:

    npm install -g npm@latest
    npm install

  This should fix your project.
  
  If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
  Then run in your project directory:

    yarn

  This should fix your project.

  Importantly, **if you decided to use yarn, you should never run `npm install` in the project**.
  For example, yarn users should run `yarn add <library>` instead of `npm install <library>`.
  Otherwise your project will break again.

  Have you done all these steps and still see the issue?
  Please paste the output of `npm --version` and/or `yarn --version` to confirm.
-->

Yes

### Which terms did you search for in User Guide?

<!--
  There are a few common documented problems, such as watcher not detecting changes, or build failing.
  They are described in the Troubleshooting section of the User Guide:

  https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting

  Please scan these few sections for common problems.
  Additionally, you can search the User Guide itself for something you're having issues with:
  
  https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md
  
  If you didn't find the solution, please share which words you searched for.
  This helps us improve documentation for future readers who might encounter the same problem.
-->

`invalid string length`

### Environment

<!--
  Please fill in all the relevant fields by running these commands in terminal.
-->

1. `node -v`: `v8.4.0`
3. `yarn --version` (if you use Yarn): `1.3.2`
4. `npm ls react-scripts` (if you haven’t ejected): `1.1.1`

Then, specify:

1. Operating system: Mac os
2. Browser and version (if relevant): n/a


### Steps to Reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

(Write your steps here:)

1. run `yarn start`
2. make a few changes, causing recompliation
3. wait until the error happens


### Expected Behavior

<!--
  How did you expect the tool to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

This shouldn't happen

### Actual Behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Please attach screenshots if possible! They are extremely helpful for diagnosing issues.
-->

The error above gets thrown into the terminal, and the process stops.


---

I've seen this error reported in a few different repos:
* https://github.com/jantimon/html-webpack-plugin/issues/855
* https://github.com/webpack/webpack/issues/6501