#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

1 messages · Page 1 of 1 (latest)

winter spire
#

After updating to Typescript 4.9.5 I'm getting this error on large project. Was able to narrow it to i18next and custom definitions that supports resource types:

const resourcesStatic = {
    en: {
        "web.payments.payment_details": "Payment Details",
    },
} as const;

declare module "i18next" {
    interface CustomTypeOptions {
        resources: typeof resourcesStatic;
    }
}

After that tried to generate trancing and it showed, that structuredTypeRelatedTo type check was an issue from /src/utils/translations.ts that has following code

import type { TFuncKey, Namespace } from "i18next";
import { i18n } from "next-i18next";

export const lazyTranslate = <N extends Namespace>(
    key: TFuncKey<N>,
    ns: N,
    options?: object
): string | undefined => {
    return i18n?.t(key, { ns, ...options }) ?? undefined;
};
#

I'm using latest stable node, latest other libs. issue not appearing with typescript 4.8 and below.

#

not sure if this should be moved to github issues for typescript or i18next.