Base solution for your next web application
Open Closed

ng build --prod fails on Azure: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed #6990


User avatar
0
yoshrepublic created

My azure pipeline fails at the ng build --prod step. This does not happen locally. I am on version 6.5. I have the same version of yarn locally.

Output of step:

##[section]Starting: Command Line Script
==============================================================================
Task         : Command Line
Description  : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
Version      : 2.148.0
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
Generating script.
Script contents:
d:\a\1\s\node_modules\.bin\ng.cmd build --prod
========================== Starting Command Output ===========================
##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\25f9c426-3bbc-41dd-92ee-0fc57fb89c88.cmd""
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF7A9AEF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114
 2: 00007FF7A9ACA0C6 node::MakeCallback+4518
 3: 00007FF7A9ACAA30 node_module_register+2032
 4: 00007FF7A9D520EE v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF7A9D5201F v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF7AA272BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556
 7: 00007FF7AA269C46 v8::internal::ScavengeJob::operator=+24310
 8: 00007FF7AA26829C v8::internal::ScavengeJob::operator=+17740
 9: 00007FF7AA267765 v8::internal::ScavengeJob::operator=+14869
10: 00007FF7AA271064 v8::internal::Heap::MaxHeapGrowingFactor+2548
11: 00007FF7A9E321C0 v8::internal::Factory::NewByteArray+112
12: 00007FF7AA4968AC v8::internal::compiler::MachineOperatorReducer::ReduceFloat64RoundDown+7564
13: 00007FF7AA18C920 v8::internal::compiler::Pipeline::AllocateRegistersForTesting+4608
14: 00007FF7AA184CCB v8::internal::compiler::ValueNumberingReducer::operator=+10123
15: 00007FF7AA252ACA v8::internal::Zone::NewExpand+1978
16: 00007FF7AA2550E4 v8::internal::Zone::NewExpand+11732
17: 00007FF7AA2BD589 v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions+393
18: 00007FF7AA099633 v8::internal::StackGuard::HandleInterrupts+531
19: 00007FF7A9EC26E7 v8::internal::WasmJs::Install+27911
20: 00000348008DC5C1 
##[error]Cmd.exe exited with code '134'.
##[section]Finishing: Command Line Script

YML script:

pool:
  name: Hosted VS2017
  demands: npm

steps:
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  displayName: 'Use Yarn 1.x'
  inputs:
    checkLatest: true

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2
  displayName: 'Yarn install'
  inputs:
    Arguments: install

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2
  displayName: 'Yarn: yarn upgrade caniuse-lite browserslist'
  inputs:
    Arguments: 'upgrade caniuse-lite browserslist'

- task: Npm@0
  displayName: 'npm install'
  inputs:
    arguments: '-g @angular/cli'

- script: '$(Build.SourcesDirectory)\node_modules\.bin\ng.cmd build --prod'
  displayName: 'Command Line Script'

- task: CopyFiles@2
  displayName: 'Copy Files to: $(System.DefaultWorkingDirectory)/dist/assets'
  inputs:
    Contents: appconfig.json
    TargetFolder: '$(System.DefaultWorkingDirectory)/dist/assets'

- task: Npm@1
  displayName: 'npm custom'
  inputs:
    command: custom
    verbose: false
    customCommand: 'build-prod'

Output yarn:

##[section]Starting: Yarn install
==============================================================================
Task         : Yarn task
Description  : Executes Yarn
Version      : 2.8.1001
Author       : Geek Learning
Help         : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 2.8.1001).

Dear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)
==============================================================================
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
[command]C:\windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\yarn\1.16.0\x64\yarn-v1.16.0\bin\yarn.cmd install"
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @swimlane/[email protected]" has unmet peer dependency "d3@^4.10.2".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-array@^1.2.1".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-brush@^1.0.4".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-color@^1.0.3".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-force@^1.1.0".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-format@^1.2.0".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-hierarchy@^1.1.5".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-interpolate@^1.1.5".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-scale@^1.0.6".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-selection@^1.1.0".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-shape@^1.2.0".
warning " > @swimlane/[email protected]" has unmet peer dependency "d3-time-format@^2.1.0".
warning " > [email protected]" has incorrect peer dependency "@angular/core@^7.1.4".
warning " > [email protected]" has incorrect peer dependency "@angular/common@^7.1.4".
[4/4] Building fresh packages...
Done in 131.50s.
##[section]Finishing: Yarn install


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Try this:

    https://github.com/angular/angular-cli/issues/13734#issuecomment-490065260