Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Build production return fatal javascript invalid size error

I'm trying to build project with command:

ng build main-app --configuration production

Then I get below error:

# Fatal error in , line 0
# Fatal JavaScript invalid size error 169224860
#
#
#
#FailureMessage Object: 000000309AFEE5A0
1: 00007FF71F0C815F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079
2: 00007FF71EFE343F std::basic_ostream<char,std::char_traits<char> >::operator<<+65023
3: 00007FF71FCC2EE2 V8_Fatal+162
4: 00007FF71F846D35 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArray+101
5: 00007FF71F6F02F3 v8::internal::FeedbackNexus::ic_state+62771
6: 00007FF71F706E50 v8::debug::Script::GetIsolate+15840
7: 00007FF71F57A9A1 v8::internal::CompilationCache::IsEnabledScriptAndEval+26913
8: 00007FF71FA19701 v8::internal::SetupIsolateDelegate::SetupHeap+494417
9: 0000021BBA9BCCE5

I try to clean cache and delete node_modules but it's not solved,Then try to change version of nodejs but problem not solved.

How can I solve this problem and deploy my project.

like image 945
diamondhna Avatar asked Mar 12 '26 08:03

diamondhna


2 Answers

In my case I deleted the .cache folder in the root of the project and again ran ng serve. It worked. PS: you dont need to worry about deleting the folder since angular would rebuild it.

like image 163
Wisely D Cruizer Avatar answered Mar 14 '26 21:03

Wisely D Cruizer


I had a similar issue and deleting the source is troublesome for me, so what I did was to:

  1. Close VSCode.
  2. Rename project folder.
  3. Open VSCode.
  4. Open the renamed project folder.
  5. Trust the source.
  6. Run the command again.

These steps fixed my problem.

like image 35
Christian Paul Gastardo Avatar answered Mar 14 '26 21:03

Christian Paul Gastardo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!