g-plane / typed-query-selector

Better typed `querySelector` and `querySelectorAll`.

Home Page:https://www.npmjs.com/package/typed-query-selector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest version causes "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"

fregante opened this issue · comments

Unfortunately the very last commit breaks my build:

❯ nr build:typescript

<--- Last few GCs --->

[13674:0x1049d5000]    14563 ms: Mark-sweep (reduce) 4061.5 (4081.6) -> 4061.5 (4074.6) MB, 84.2 / 0.0 ms  (average mu = 0.245, current mu = 0.001) last resort GC in old space requested
[13674:0x1049d5000]    14655 ms: Mark-sweep (reduce) 4061.5 (4074.6) -> 4061.4 (4074.6) MB, 91.9 / 0.0 ms  (average mu = 0.140, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x1013611f5 node::Abort() (.cold.1) [/usr/local/bin/node]
 2: 0x1000be519 node::Abort() [/usr/local/bin/node]
 3: 0x1000be67f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 4: 0x10022f6a7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0x10022f643 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 6: 0x1003e9a95 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 7: 0x1003f2ddc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 8: 0x1003baa4e v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [/usr/local/bin/node]
 9: 0x1006553f8 v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/usr/local/bin/node]
10: 0x100789c1d v8::internal::Runtime_StringCompareSequence(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
11: 0x100ac1f19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
12: 0x100b29144 Builtins_StringPrototypeStartsWith [/usr/local/bin/node]
fish: Job 1, 'npm run --silent $argv' terminated by signal SIGABRT (Abort)

Source, if you want to try it yourself: be6645f (#3831)

Tested on a MacBook with 16GB of RAM, macOS 10.15.7


I copy-pasted the content of parser.d.ts into my node_modules and verified that this only happens with the very last commit currently on master (c5b91d8); It's able to compile with 2f0d7ba

Thanks for your report. I will try reproducing later.

Sorry for bothering you 😅

Thank you! It fixed all of my issues! refined-github/refined-github#3831 fregante/select-dom#15

I'm only encountering this problem with tsd, but I'll look into it later, it's probably not a problem with your types: https://github.com/fregante/select-dom/pull/15/checks?check_run_id=1621128305

I've released v2.2.3 just now with some optimizations. Feel free to try and report issues.

Tested, all issues have been solved!