i18next: TypeScript ESLint crash after 22.4.4 when passing TFunction

💥 Regression Report

When using @typescript-eslint/no-misused-promises to lint a TypeScript project with i18next CustomTypeOptions set, the linter will crash when attempting to analyze the function arguments of a function which is passed TFunction type. (This is a continuation of #1891 but now with a minimal reproduction.)

Error received:

➜  i18next-eslint-repro  $ npm run lint

> i18next-eslint-repro@1.0.0 lint
> eslint src/**


<--- Last few GCs --->

[8512:000001F9FC78AFD0]   144555 ms: Mark-sweep (reduce) 3699.7 (3799.6) -> 3699.7 (3753.6) MB, 1889.0 / 0.0 ms  (average mu = 0.706, current mu = 0.000) last resort GC in old space requested
[8512:000001F9FC78AFD0]   146347 ms: Mark-sweep (reduce) 3699.7 (3753.6) -> 3699.7 (3753.4) MB, 1791.8 / 0.0 ms  (average mu = 0.548, 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: 00007FF618FD7A1F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114207
 2: 00007FF618F66096 DSA_meth_get_flags+65542
 3: 00007FF618F66F4D node::OnFatalError+301
 4: 00007FF61989B2CE v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF6198858AD v8::SharedArrayBuffer::Externalize+781
 6: 00007FF619728C7C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
 7: 00007FF61972381E v8::internal::Heap::AllocateExternalBackingStore+2270
 8: 00007FF619741420 v8::internal::FreeListManyCached::Reset+1408
 9: 00007FF619741AD5 v8::internal::Factory::AllocateRaw+37
10: 00007FF619753A7E v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray+46
11: 00007FF6197566BA v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller+74
12: 00007FF619756913 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithMap+35
13: 00007FF619554608 v8::internal::OrderedNameDictionary::Add<v8::internal::LocalIsolate>+856
14: 00007FF619554BC7 v8::internal::OrderedNameDictionary::FindEntry<v8::internal::LocalIsolate>+247
15: 00007FF619554A54 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap,2>::EnsureGrowable<v8::internal::Isolate>+100
16: 00007FF619484FCF v8::internal::CompilationCache::IsEnabledScriptAndEval+5775
17: 00007FF619928FC1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
18: 00007FF619903B7B v8::internal::SetupIsolateDelegate::SetupHeap+341771
19: 000001F9804B3EEF

Last working version

Worked up to version: 22.4.3

Stopped working in version: 22.4.4

To Reproduce

Very minimal repo here: https://github.com/CreativeTechGuy/i18next-eslint-repro

  • Pull code
  • npm ci to install dependencies
  • npm run lint to cause the crash (it’ll stall for a while but if you leave it long enough it’ll crash with an error similar to above)

Expected behavior

The code can be linted without issue.

Your Environment

  • runtime version: Node 16.15.0
  • i18next version: 22.4.4
  • os: Windows

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Most upvoted comments

not stale

Hey @CreativeTechGuy, I’m glad to hear that! The defaults values should be available in the next patch version: 18ce83f

fyi: released in v23.1.0

@adrai can you turn off the stale bot?