Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.0.1] - Type instantiation is excessively deep and possibly infinite #1972

Closed
esetnik opened this issue Jun 15, 2023 · 9 comments
Closed
Assignees

Comments

@esetnik
Copy link

esetnik commented Jun 15, 2023

馃悰 Bug Report

After updating to v23.0.1 I am getting typescript errors. The previously working version is v22.4.3.

To Reproduce

A minimal reproducible example.
A codesandbox example or similar
or at least steps to reproduce the behavior:

            <Trans
              i18nKey="titles.paymentPastDue"
              components={[
                <b></b>,
                <LinkStyled href={`mailto:${SALES_EMAIL}`} />,
              ]}
              t={t}
              values={{ email: SALES_EMAIL }}
            />

Expected behavior

A clear and concise description of what you expected to happen.

No error

Your Environment

  • runtime version: typescript v5.1.3
  • i18next version: v23.0.1
  • os: Linux
  • any other relevant information
image
@adrai
Copy link
Member

adrai commented Jun 15, 2023

Please provide a reproducible example repository.
Also make sure you've updated also react-i18next.

@pedrodurek
Copy link
Member

Yes, we need a reproducible example to ensure it isn't a problem with your configuration

@falsandtru falsandtru mentioned this issue Jun 17, 2023
@hakubo
Copy link

hakubo commented Jun 21, 2023

Found a workaround for now: i18next/react-i18next#1417 (comment) "solution" number one seems to work for me

@esetnik
Copy link
Author

esetnik commented Jun 21, 2023

I am unable to reproduce in a sample project thus far. It seems we need a project of sufficient complexity to generate the issue. I have 10 namespaces in my production project. I am also still experiencing the issue reported in #1883 after updating to i18next@23.2.2 + react-i18next@13.0.0.

For now I will stay on:

i18next 22.4.3聽
react-i18next 12.3.1

which are the latest versions available that do not exhibit the issues.

@adrai
Copy link
Member

adrai commented Jun 22, 2023

@esetnik in case you were using the Trans component of react-i18next... please try with i18next v23.2.3 and react-i18next 13.0.1

@esetnik
Copy link
Author

esetnik commented Jun 22, 2023

@adrai unfortunately it didn't solve the issue in #1883

<--- Last few GCs --->

[349:0x6768ee0]   133508 ms: Scavenge 2023.5 (2083.8) -> 2017.9 (2083.8) MB, 7.4 / 0.0 ms  (average mu = 0.546, current mu = 0.630) allocation failure; 
[349:0x6768ee0]   133522 ms: Scavenge 2024.4 (2083.8) -> 2019.5 (2083.8) MB, 6.0 / 0.0 ms  (average mu = 0.546, current mu = 0.630) allocation failure; 
[349:0x6768ee0]   133555 ms: Scavenge 2026.1 (2083.8) -> 2020.3 (2099.8) MB, 12.1 / 0.0 ms  (average mu = 0.546, current mu = 0.630) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb7a940 node::Abort() [/usr/local/bin/node]
 2: 0xa8e823  [/usr/local/bin/node]
 3: 0xd5c990 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0xd5cd37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0xf3a435  [/usr/local/bin/node]
 6: 0xf4c91d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 7: 0xf2701e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 8: 0xf283e7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 9: 0xf08930 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0xeffefc v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/usr/local/bin/node]
11: 0xf00075 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/usr/local/bin/node]
12: 0x11bafbe v8::internal::MaybeHandle<v8::internal::OrderedHashMap> v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate<v8::internal::Isolate>(v8::internal::Isolate*, int, v8::internal::AllocationType) [/usr/local/bin/node]
13: 0x11bb073 v8::internal::MaybeHandle<v8::internal::OrderedHashMap> v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash<v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/usr/local/bin/node]
14: 0x12c53bd v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
15: 0x16fb6f9  [/usr/local/bin/node]
Aborted (core dumped)
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Exited with code exit status 134

@pedrodurek
Copy link
Member

Hey @esetnik, did it solve the Type instantiation is excessively deep and possibly infinite issue?

@alexander7161
Copy link

Fixed for me 馃憤

@esetnik
Copy link
Author

esetnik commented Jun 22, 2023

Sorry I didn't see that this is a dupe of #1921 so i'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants