create-react-app
create-react-app copied to clipboard
Invalid string length error thrown
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
node -v:v8.4.0yarn --version(if you use Yarn):1.3.2npm ls react-scripts(if you haven’t ejected):1.1.1
Then, specify:
- Operating system: Mac os
- Browser and version (if relevant): n/a
Steps to Reproduce
(Write your steps here:)
- run
yarn start - make a few changes, causing recompliation
- 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:
- https://github.com/jantimon/html-webpack-plugin/issues/855
- https://github.com/webpack/webpack/issues/6501
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
Very weird -- we're upgrading to webpack 4 soon and discontinuing use of webpack-dev-server, so hopefully this goes away in 2.x.
Also experiencing this:
- Create React App:
1.4.3 - Webpack:
3.8.1 - Webpack Dev Server:
2.11.3 - OS:
Windows 10 Pro version 1803 - Node:
8.9.1(will update this, assume that had no effect if I do not follow up)
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)}`;
Is this still a thing thats happening?
@eddiemonge unfortunately yes
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.