question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid string length error thrown

See original GitHub issue

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:

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Mar 5, 2018

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

1reaction
reohjscommented, Feb 26, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught RangeError: Invalid string length when appending ...
I got this error: Uncaught RangeError: Invalid string length. And Fix it by use i for outer for loop, use DIFFERENT j for...
Read more >
RangeError: Invalid string length with large files. · Issue #35973
When i'm trying to read a large Json File (700MB - 26.640.222 lines) using ReadStream i'm getting the error: "RangeError: Invalid string length" ......
Read more >
RangeError: invalid array length - JavaScript - MDN Web Docs
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds ...
Read more >
HTML : Uncaught RangeError: Invalid string length ... - YouTube
HTML : Uncaught RangeError: Invalid string length when appending to a string in JavaScript [ Beautify Your Computer ...
Read more >
Error: Invalid string. Length must be a multiple of 4
Hi Can anyone help to resolve the issue, Any comment is much appreciated. The issue and log is given below. Invalid string. Length...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found