help icon indicating copy to clipboard operation
help copied to clipboard

Fatal JavaScript invalid size error 169220804

Open honk7608 opened this issue 3 years ago • 20 comments
trafficstars

Details

#
#Fatal error in , line 0
#Fatal JavaScript invalid size error 169220804
#
#
#
#FailureMessage Object: 0000007BACEF9D60
 1: 00007FF625B0401F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112511
 2: 00007FF625A2116F v8::CFunctionInfo::HasOptions+7055
 3: 00007FF6266F7302 V8_Fatal+162
 4: 00007FF626280C65 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArray+101
 5: 00007FF62612A463 v8::internal::FeedbackNexus::ic_state+62771
 6: 00007FF626140FC0 v8::Message::GetIsolate+15840
 7: 00007FF625FB5681 v8::internal::CompilationCache::IsEnabledScriptAndEval+26849
 8: 00007FF6264534B1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
 9: 000001872985A558 

Why this error happend and how can I fix?

Node.js version

v16.13.2

Example code

No response

Operating system

Window 11

Scope

runtime

Module and version

Not applicable.

honk7608 avatar Feb 08 '22 13:02 honk7608

Anyone who can resolve this issue?

luorixiangyang avatar Feb 24 '22 02:02 luorixiangyang

According to the stacktrace of the error, it seems like you're trying to initialize an array with way too many elements, this is caused by the V8 engine as there's a maximum array size specified.

The maximum amount of elements can vary depending on the target machine, but the common maximum size is the 32-bit unsigned integer, AKA 4,294,967,296 (4,29 billion) elements, if you try to create an array larger than this, that can be caused, although as said, this is depenedent on the target machine and the maximum heap it could provide as well.

VoltrexKeyva avatar Feb 24 '22 18:02 VoltrexKeyva

How can I find out which line of code causes the array that is too big?

Too bad there isn't a stacktrace of the Javascript code that causes it. After all, there is a specific line of code that adds the element that makes the array too big.

In my case, it seems to be a non-terminating loop that adds elements to an array. Of course there are methods to find the cause, but a stacktrace would be quite helpful.

yolpsoftware avatar Apr 02 '22 08:04 yolpsoftware

I moved "react-scripts": "5.0.1" from dependencies to devDependencies in package.json , this saved me.

rdtriny avatar May 11 '22 02:05 rdtriny

I moved "react-scripts": "5.0.1" from dependencies to devDependencies in package.json , this saved me.

It works for me. What is the impact of this config change?

linlei2099 avatar May 21 '22 08:05 linlei2099

how did you fix that error in your code? cause am having the same error

MYLESMUGISHA avatar Oct 23 '22 05:10 MYLESMUGISHA

What framework are you using, For me, I lowered the next.js version and it worked.

occupy5 avatar Jan 11 '23 05:01 occupy5

I was having this issue with Nestjs v 9.20 when I tried to install stripe. I moved all of my @types/* dependecies to dev dependencies and now everything works.

zain-fortech avatar Feb 22 '23 10:02 zain-fortech

I'm having this issue with NextJS 12.3 when dev is set to true like const nextServer = next({ dev: true });

Edit: I resolved it by deleting the .next folder.

TheSecurityDev avatar Mar 29 '23 19:03 TheSecurityDev

What I want to know is why this error instantly crashes Node with no backtrace and no meaningful explanation - surely this could just be handled by throwing an exception, which would allow the error to be caught by test runners and presented nicely in CI rather than causing everything to break.

MaddyGuthridge avatar Jun 18 '23 06:06 MaddyGuthridge

I moved "react-scripts": "5.0.1" from dependencies to devDependencies in package.json , this saved me.

Muhangi2 avatar Jun 30 '23 11:06 Muhangi2

i encountered this error using JSFuck 0.5.0

Aworldc avatar Jul 06 '23 23:07 Aworldc

I was having this issue with Nestjs v 9.20 when I tried to install stripe. I moved all of my @types/* dependecies to dev dependencies and now everything works.

Thank's its work for me 👍❤️

MridulSheikh avatar Sep 08 '23 15:09 MridulSheikh

In my case, it was a cyclical dependency within a monorepo project. Turbo was able to recognise this when I tried to run a custom cleanup job, which removes all .turbo, .next, node_modules, and re-installs everything. It failed with the exact cyclical path.

yanickrochon avatar Mar 04 '24 02:03 yanickrochon

In my case, it was a cyclical dependency within a monorepo project. Turbo was able to recognise this when I tried to run a custom cleanup job, which removes all .turbo, .next, node_modules, and re-installs everything. It failed with the exact cyclical path.

@yanickrochon could you share the contents of your cleanup job? I am facing the same issue in a monorepo project.

tom-carbontrail avatar Mar 12 '24 19:03 tom-carbontrail

@tom-carbontrail sure!

The turborepo's root package.json has this (partial file content):

{
  "private": true,
  "packageManager": "[email protected]",
  "scripts": {
    "reset": "turbo reset && rimraf pnpm-lock.yaml node_modules && pnpm i"
  },
  "devDependencies": {
    "rimraf": "^5.0.5"
  }
}

The turbo.json file (partial)

{
  "$schema": "https://turborepo.org/schema.json",
  "pipeline": {
    "reset": {
      "cache": false
    }
  }
}

Each of my package.json look like this (partial, update according to your own build requirements) :

{
  "name": "@vit3x/accounts",
  "scripts": {
    "reset": "rimraf .next .turbo node_modules"
  }
}

Thens imply run pnpm reset. This will flush all artefacts and node_modules, then reinstall everything.

yanickrochon avatar Mar 13 '24 12:03 yanickrochon

Ah I see. My files look similar, I wondered if you were running a script or similar to detect cyclic dependencies.

I added 'import/no-cycle': ["warn"], to my Eslint config to help me find them in my project, and found the culprits. My tests (with jest) now run again.

Thanks for your help.

tom-carbontrail avatar Mar 13 '24 18:03 tom-carbontrail

@tom-carbontrail pnpm warns about cyclical dependencies when you run pnpm i and it has to rebuild the cache. If your solution works, that's great too!

yanickrochon avatar Mar 13 '24 19:03 yanickrochon

I moved "react-scripts": "5.0.1" from dependencies to devDependencies in package.json , this saved me too.

srayo16 avatar Apr 23 '24 10:04 srayo16

Hi! If this issue is resolved, could a member (or the author) close it? If it's not resolved, ignore this message.

If you don't have access, and you think this issue is resolved, :+1: this message, and I'll close the issue myself.

Thanks!

avivkeller avatar Jun 28 '24 00:06 avivkeller

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Dec 25 '24 01:12 github-actions[bot]

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Jan 24 '25 01:01 github-actions[bot]