JavaScript heap out of memory with googleapis

When i have import { google } from ‘googleapis’; in my code and try to deploy it, i got en error:
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory.
I am not using any function from this library, just importing it
Here is my code:
import { Injectable } from ‘@nestjs/common’;
import { google } from ‘googleapis’;

@Injectable()
export class GoogleSheetsService {
private readonly spreadsheetId =
‘1WACs-GH1XMvpK1cmWgihgjtwUBZKrPGtPjOxVkX0r9s’;

async fetchSheetData(range: string) {
console.log(‘ABRACADABRA’, range);
}

}
Full error:
==> Running ‘npm start’

Dec 3 05:17:58 PM==> Common ways to troubleshoot your deploy: https://render.com/docs/troubleshooting-deploys

Dec 3 05:17:58 PM==> Exited with status 134

Dec 3 05:17:43 PMAborted (core dumped)

Dec 3 05:17:40 PM10: 0x1df1476 [node]

Dec 3 05:17:40 PM 9: 0x189712c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]

Dec 3 05:17:40 PM 8: 0x1435cee v8::internal::factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]

Dec 3 05:17:40 PM 7: 0x145d015 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]

Dec 3 05:17:40 PM 6: 0x145c0e8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]

Dec 3 05:17:40 PM 5: 0x1487a19 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]

Dec 3 05:17:40 PM 4: 0x146e1a5 [node]

Dec 3 05:17:40 PM 3: 0x1240667 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]

Dec 3 05:17:40 PM 2: 0x1240390 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]

Dec 3 05:17:40 PM 1: 0xe19de0 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]

Dec 3 05:17:40 PM

Dec 3 05:17:40 PM----- Native stack trace -----

Dec 3 05:17:40 PMFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Dec 3 05:17:40 PM

Dec 3 05:17:40 PM<— JS stacktrace —>

Dec 3 05:17:40 PM

Dec 3 05:17:40 PM

Dec 3 05:17:40 PM[107:0x40bb9000] 57500 ms: Mark-Compact 252.4 (258.6) → 251.9 (259.1) MB, pooled: 0 MB, 2204.41 / 0.00 ms (average mu = 0.147, current mu = 0.045) allocation failure; scavenge might not succeed

Dec 3 05:17:40 PM[107:0x40bb9000] 55191 ms: Mark-Compact 252.1 (258.3) → 251.4 (258.6) MB, pooled: 0 MB, 1693.59 / 0.00 ms (average mu = 0.253, current mu = 0.151) allocation failure; scavenge might not succeed

Dec 3 05:17:40 PM

Dec 3 05:17:40 PM<— Last few GCs —>

Dec 3 05:17:39 PM

Dec 3 05:17:10 PM==> Docs on specifying a port: https://render.com/docs/web-services#port-binding

Dec 3 05:17:10 PM==> No open ports detected, continuing to scan…

Dec 3 05:16:42 PM

Dec 3 05:16:42 PM> nest start

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.