# FATAL ERROR during 'Deploy your serverless infrastructure'

**URL:** <https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489>\
**Category:** Chapter Comments\
**Created:** [December 13, 2019, 8:42pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489 "2019-12-13T20:42:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![z4carlo](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/z4carlo/32/720_2.png) [@z4carlo](https://discourse.sst.dev/u/z4carlo)\
**Post date:** [December 13, 2019, 8:42pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/1 "2019-12-13T20:42:58Z")

</div>

My react app is now quite different form the example scratch app after editing and building a number of different APIs and successfully deploying them through the CLI.

When I try to run serverless deploy -v through GitBash in Windows I get the following response;

```auto
$ serverless deploy -v
Serverless: DOTENV: Loading environment variables from .env:
Serverless: - SAMPLE_ENV_VAR
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF6980F094F napi_wrap+124431
 2: 00007FF698092696 v8::base::CPU::has_sse+34502
 3: 00007FF698093356 v8::base::CPU::has_sse+37766
 4: 00007FF698896F4E v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF69887EF91 v8::SharedArrayBuffer::Externalize+833
 6: 00007FF69874C85C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436
 7: 00007FF698757C00 v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312
 8: 00007FF698754734 v8::internal::Heap::PageFlagsAreConsistent+3204
 9: 00007FF698749FC3 v8::internal::Heap::CollectGarbage+1283
10: 00007FF6987493B4 v8::internal::Heap::CollectAllAvailableGarbage+196
11: 00007FF69874880F v8::internal::Heap::AddRetainedMap+2479
12: 00007FF698770623 v8::internal::Factory::NewRawOneByteString+83
13: 00007FF698465EC3 v8::internal::StringStream::ClearMentionedObjectCache+10467
14: 00007FF6984B67E8 v8::internal::DeclarationScope::was_lazily_parsed+48648
15: 00007FF6984AFBE0 v8::internal::DeclarationScope::was_lazily_parsed+20992
16: 00007FF6984B03AF v8::internal::DeclarationScope::was_lazily_parsed+22991
17: 00007FF698CC2C6D v8::internal::SetupIsolateDelegate::SetupHeap+567949
18: 00007FF698CFECAA v8::internal::SetupIsolateDelegate::SetupHeap+813770
19: 00007FF698CAF815 v8::internal::SetupIsolateDelegate::SetupHeap+489013
20: 000001F1B47890A9

```

I am unsure where to begin with this issue so any help is appreciated.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [December 16, 2019, 1:40am UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/2 "2019-12-16T01:40:35Z")

</div>

Hmm usually out of memory errors happen with `serverless-webpack` or in our case the `serverless-bundle` plugin. Are you using either?

---

<div class="post-metadata">

**Author:** ![z4carlo](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/z4carlo/32/720_2.png) [@z4carlo](https://discourse.sst.dev/u/z4carlo)\
**Post date:** [December 16, 2019, 6:06pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/3 "2019-12-16T18:06:32Z")

</div>

This is in my package.json;

```auto
"devDependencies": {
    "aws-sdk": "^2.576.0",
    "serverless-bundle": "^1.2.5",
    "serverless-dotenv-plugin": "^2.1.1",
    "serverless-offline": "^5.3.3"
  },

```

So I assume, yes I am using serverless-bundle? Is this incorrect?

Thanks

---

<div class="post-metadata">

**Author:** ![z4carlo](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/z4carlo/32/720_2.png) [@z4carlo](https://discourse.sst.dev/u/z4carlo)\
**Post date:** [December 22, 2019, 1:46pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/4 "2019-12-22T13:46:36Z")

</div>

@jayair any follow up on this?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [January 12, 2020, 3:29am UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/5 "2020-01-12T03:29:49Z")

</div>

The out of memory errors from `serverless-webpack` is a little common. How many functions do you have? To get around this you can disabling this in your `serverless.yml`.

```auto
package:
  individually: true

```

---

<div class="post-metadata">

**Author:** ![filo47](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@filo47](https://discourse.sst.dev/u/filo47)\
**Post date:** [May 3, 2020, 8:31pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/6 "2020-05-03T20:31:12Z")

</div>

Great tutorial. I have been following along with no issue. Only purposeful deviation is a unique server name and using yarn rather than npm. While deploying via seed I get this error, “FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory.” Any advice?

UPDATE: fixed issue by setting env variable key: NODE\_OPTIONS and value: --max-old-space-size=8192. Not sure if this is correct solution?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [May 17, 2020, 6:20pm UTC](https://discourse.sst.dev/t/fatal-error-during-deploy-your-serverless-infrastructure/1489/7 "2020-05-17T18:20:46Z")

</div>

Oh that’s weird. How much memory was Node using by default?
