Ionic, 200+ pages, build production .out of memory error


#21

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
no…no…no…

can you give me your ionic info


#22

Mate i am also not able to run this command, so i have to use ionic cordova run android command.

Below is my ionic info:

global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.0.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.1

System:

Node       : v7.10.0
OS         : Windows 8.1
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

#23

Have you solved this problem?


#24

Can you create a simple Ionic project on Github that causes this behaviour? Then maybe other people can try to solve it.


#25

Working with this command: ionic cordova run android

Will checkout this command (ionic cordova run android --prod) later


#26

with no --prod,it’s work for me too…but when --prod ,error occurs.


#27

Yes, Same here. Because --prod is taking too much load on my RAM. And my RAM memory gets the full usage, i get the error of heap out of memory.


#28

ok ,i have update my demo code to github:demo code

in my plugins i add some other ,but it’s too big for me to upload ,i will upload it soon

pls help ,thx!!!


#29

Ok, what exact commands should I run after downloading this? CLI v3?


#30

yes

global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.0.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.1

System:

Node       : v6.10.3

#31

And the command to run?


#32

ionic cordova build android --prod


#33

You have only uploaded 12 pages. I think in 12 pages this command will run. My command is working in 12 pages but i have more than 20pages. So it’s breaking.


#34

hehe!!! pls have a try…running it ,and tell me the result :smiley:

ionic cordova build android --prod


#35

I get a build failure:

[15:00:44]  typescript: src/pages/quotation/Chat/partQuotation.ts, line: 61 
            Cannot find name 'Model_OfferOrderDetail'. 

      L61:   OfferOrderDetail:Model_OfferOrderDetail={
      L62:       OfferOrderID:"",

[15:00:44]  typescript: src/pages/quotation/MyOrder/CenterPartQuotation.ts, line: 57 
            Cannot find name 'Model_OfferOrderDetail'. 

      L57:  OfferOrderDetail:Model_OfferOrderDetail={
      L58:      OfferOrderID:"",

[15:00:44]  typescript: src/providers/QuotationViewModel/QuotationModelConvert.ts, line: 9 
            Cannot find name 'Model_Dictionary'. 

       L8:  var model:Model_Dictionary={
       L9:     DictCode:dictCode,
      L10:     DictName:dictName,

#36

I get more of these than I can post here :wink:
But after that the project actually builds, without any problems.


#37

Not for me. www/build is empty.


#38

sorry !!some plugins not in config.xml file


#39


#40

Showing this is no help, you have to readd them on the command line (like I showed you with the wechat plugin) and then commit again.

I can now build the state from Github with “only” ~8 warnings, but everything else is working fine. Node takes around 1200 MB of Memory at the peak.