After upgrading to node 11.1 webpack-dev-server (i assume) can't serve angular 5 app build with this error:
webpack: Compiled successfully.
buffer.js:72
class FastBuffer extends Uint8Array {}
^
RangeError: Invalid typed array length: -4095
at new Uint8Array (<anonymous>)
at new FastBuffer (buffer.js:72:1)
at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:121:17) at Stream.<anonymous>
(node_modules/handle-thing/lib/handle.js:120:12)
at Stream.emit (events.js:187:15) at endReadableNT
(node_modules/readable-stream/lib/_stream_readable.js:992:12)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
I'm also seeing the same thing trying to start a react app with yarn.
I ran into the same error. It's not a total fix but downgrading my node version got me back up and running. Here's what I did:
sudo npm cache clean -f
sudo npm install -g n
sudo n <version>
<- I downgraded to 10.6.0
Pretty sure that message is coming from V8. Not sure if it's a bug in V8, or the result of a bug fix in V8, or neither... @nodejs/v8
cc @psmarshall
fixed by removing all node folders, reinstalling nvm, reinstalling node
Throwing when a typed array is constructed with a negative length argument is the correct behaviour according to the spec. I don't think we changed anything here recently, so the bug is most likely in node or one of the modules used
Also seeing this starting in the last couple of days. Webpack will compile it okay, but once you make a request it collapses in on itself.
Can get around the crash by going back to older node (10.6.0 worked okay), but that kinda has problems of its own.
Project is running at <redacted>
webpack output is served from /
404s will fallback to /index.html
webpack: wait until bundle finished: /
buffer.js:72
class FastBuffer extends Uint8Array {}
^
RangeError: Invalid typed array length: -4095
at new Uint8Array (<anonymous>)
at new FastBuffer (buffer.js:72:1)
at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:121:17)
at Stream.<anonymous> (<redacted>/node_modules/handle-thing/lib/handle.js:120:12)
at Stream.emit (events.js:187:15)
at endReadableNT (<redacted>/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
Going by the stack trace, it's almost certainly a bug in the handle-thing module. I'm going to close this out as not-our-bug. Please report it to that module's maintainers.
cc @indutny since you're one of its maintainers. If it helps, -4095 is libuv's EOF status code.
upgrading react-scripts did the trick for my create-react-app without having to downgrade from node 11:
yarn add react-scripts
rm -rf node_modules/
yarn
all better!
why not try this one instead after you uninstall the node
brew install node --HEAD
@kmiasko did you ever find a workaround? started getting this exact issue a few days back and just can't figure out what the fix is.
Same problem. Webpack can't start or dying after the first request. Before that, I update node to 11.4. Maybe it's not a node bug but I have no idea how to detect problem package. node < 10.6 works well
Yeah exact same thing here @webmcheck . Strangest thing is that this issue just popped out of nowhere. Didn't upgrade NPM or yarn or anything like that.
@webmcheck @camus-code https://github.com/spdy-http2/handle-thing/pull/5#issue-229119787
That's the package that is causing problems. It's already fixed, but packages that use older version of this package won't work on node >= 11.1 (ie. angular 5.x fails, angular 7.x works ok).
Ahhh okay. Thanks for the response @kmiasko . Ended up downgrading my node version and things are back to normal.
I'm pretty sure https://github.com/spdy-http2/handle-thing/issues/6 is the tracking issue for the NodeJS 11.x handle-thing fixes, not handle-thing#5, which was for NodeJS 10.x, but perhaps @jacobheun can confirm for certain the intent.
@eyz that's correct. I recently got supported added for node LTS versions, but ran out of time to get updates in for node 11. Internal stream behavior changed in node 11 which caused the issue in handle-thing. handle-thing needs to be updated to account for those.
Thanx to @damejia100, but instead of downgrading I've upgraded node to the latest stable version (10.15.3):
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
and the error has gone
10.17.0 also works.
Most helpful comment
I ran into the same error. It's not a total fix but downgrading my node version got me back up and running. Here's what I did:
sudo npm cache clean -f
sudo npm install -g n
sudo n <version>
<- I downgraded to 10.6.0