Hi all, is there any guide to migrate the `serverl...
# help
l
Hi all, is there any guide to migrate the
serverless-bundle
from v.2.0.0 to v4.2.0? I am having problems deploying, due to a memory overflow, caused by two things:
ForkTsCheckerWebpackPlugin
and
package: individually: true
, and I read that in the newest version is solved, but I keep getting errors.
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.1.0
YOUR TYPESCRIPT VERSION: 4.1.3
Please only submit bug reports when using the officially supported version.
=============
<--- Last few GCs --->
[122158:0x30edf60]    88394 ms: Scavenge 2041.2 (2051.4) -> 2040.5 (2051.4) MB, 8.5 / 0.0 ms  (average mu = 0.126, current mu = 0.011) allocation failure
[122158:0x30edf60]    88408 ms: Scavenge 2041.5 (2051.6) -> 2040.8 (2051.6) MB, 8.8 / 0.0 ms  (average mu = 0.126, current mu = 0.011) allocation failure
[122158:0x30edf60]    88421 ms: Scavenge 2041.7 (2051.6) -> 2041.1 (2052.1) MB, 9.6 / 0.0 ms  (average mu = 0.126, current mu = 0.011) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x140a8f9]
Security context: 0x12700cd408d1 <JSObject>
1: createIdentifier(aka createIdentifier) [0x2a540b7b1bf9] [/home/smash/Code/bank-accounts-api/node_modules/typescript/lib/typescript.js:~29311] [pc=0xd11a4227d3c](this=0x2aafcb2004b1 <undefined>,0x2aafcb200639 <true>,0x37d018226ce9 <Object map = 0x2f9b7dcb0e09>,0x2aafcb2004b1 <undefined>)
2: parseNonArrayType(aka parseNonArrayType) [0x2a540b7b36f9] [/hom...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xa18150 node::Abort() [node]
2: 0xa1855c node::OnFatalError(char const*, char const*) [node]
3: 0xb9715e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb974d9 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xd54755  [node]
6: 0xd54de6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xd616a5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xd62555 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xd6500c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd2ba2b v8::internal::factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x106dffe v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x140a8f9  [node]
That is what i get when I try to do a deploy of all my functions with the version 4.2.0., including custom: bundle: disableForkTsChecker: true in serverless.yml.
r
We found serverless-bundle a little too opinionated in terms of how it works with TypeScript so we use serverless-webpack with a manual tsc build step before running the sls deploy. However, the packageIndividually flag also caused the memory issue in serverless-webpack last time I tried it. You can experiment with allowing more memory by setting the env var (linux variants - same principle on Windows)
Copy code
export NODE_OPTIONS=--max_old_space_size=8192
l
Thanks, I will try that