hard-source-webpack-plugin icon indicating copy to clipboard operation
hard-source-webpack-plugin copied to clipboard

RangeError: "size" argument must not be larger than

Open JonWallsten opened this issue 6 years ago • 10 comments

This was a one time error. So I'm just gonna put it here as an FYI instead of a thorough report due to a tight deadline. But I just upgraded to 0.7.4 and got this error message:

RangeError: "size" argument must not be larger than 2147483647
    at Function.Buffer.allocUnsafe (buffer.js:253:3)
    at alloc (C:\Users\**\repo\**\node_modules\hard-source-webpack-plugin\lib\SerializerAppend2.js:42:17)
    at Append2._readFile (C:\Users\**\repo\**\node_modules\hard-source-webpack-plugin\lib\SerializerAppend2.js:156:14)
    at <anonymous>

JonWallsten avatar May 31 '18 09:05 JonWallsten

Before to find origin of this issue, one way to play around is to clear your cache.

rm -rf node_modules/.cache/*

yanis-git avatar Jun 11 '18 06:06 yanis-git

I also experienced the same error.

ianoti avatar Jun 25 '18 17:06 ianoti

@ianoti was it a one time thing? Or has it been repeated?

mzgoddard avatar Jun 25 '18 17:06 mzgoddard

@mzgoddard It is difficult to reproduce, but to increase the chances of seeing the error, if you are working on a branch and checkout to another branch that changes different files from what you are working on, it increases the chance of the error occurring.

I have only seen the error 3 times, haven't seen it since I cleared the cache

ianoti avatar Jun 25 '18 20:06 ianoti

I also experienced the same error.

muzea avatar Jul 03 '18 11:07 muzea

@mzgoddard My colleague reproduces this bug. When building, use Ctrl-C to cancel, then build again, you will get this error.

muzea avatar Aug 28 '18 08:08 muzea

Hi, everyone. i can reproduce this bug too. I am working on two different branch, and each branch has different package.json file(so node dependency is different)

  1. I switched to first branch and run npm install.
  2. When fetching proper packages, i canceled this process, Ctrl + C
  3. I switched to second branch and run npm install.
  4. When fetching proper packages, i canceled this process, Ctrl + C
  5. And i run npm install again on second branch.

From this time, i always get the above result. This reproduce steps is unusual, but i just want to let you know.

geekboy0801 avatar Oct 15 '18 18:10 geekboy0801

I also experience this error. [email protected] [email protected]

kobimantzur avatar Feb 04 '19 15:02 kobimantzur

Before to find origin of this issue, one way to play around is to clear your cache.

rm -rf node_modules/.cache/*

This worked for me.

I'm using: "hard-source-webpack-plugin": "^0.12.0", "webpack": "^4.24.0"

mding5692 avatar Jun 13 '19 15:06 mding5692

For me the problem was the backup .zip file that I have stored which was very large (over 2GB). So just look for large unnecessary files in your project or perhaps some cleanup should do the job.

I have experienced this error in different circumstances (in react-native project) but maybe it will help somebody.

dblachut-adb avatar Aug 07 '19 09:08 dblachut-adb