facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.76k stars 26.86k forks source link

Invalid string length error thrown #4066

Open wmonk opened 6 years ago

wmonk commented 6 years ago

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?

Yes

Which terms did you search for in User Guide?

invalid string length

Environment

  1. node -v: v8.4.0
  2. yarn --version (if you use Yarn): 1.3.2
  3. 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

(Write your steps here:)

  1. run yarn start
  2. make a few changes, causing recompliation
  3. wait until the error happens

Expected Behavior

This shouldn't happen

Actual Behavior

The error above gets thrown into the terminal, and the process stops.


I've seen this error reported in a few different repos:

reohjs commented 6 years ago

I also had this issue, though I'm not using create-react-app, just webpack-dev-server.

It seems be working after changing the devtool option to something else, and then back again, in the webpack config & freeing up some RAM

Node: 8.9.5 OS: Win 7

Timer commented 6 years ago

Very weird -- we're upgrading to webpack 4 soon and discontinuing use of webpack-dev-server, so hopefully this goes away in 2.x.

jmcgrory commented 6 years ago

Also experiencing this:

Behaviour exhibits itself after seemingly random amount of time after running npm start, abridged error:

\node_modules\webpack\lib\Stats.js:221
    text += `\n @ ${current.readableIdentifier(requestShortener)}`;
eddiemonge commented 4 years ago

Is this still a thing thats happening?

jmcgrory commented 4 years ago

@eddiemonge unfortunately yes

vgjenks commented 2 years ago

I'm suddenly having this problem and have no clue why. The error is not helpful. It just breaks on a useEffect() call that hasn't failed me for over a year now. My project is DOA until I muddle my way through this issue.