Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Error reading types file: Cannot create a string longer than 0x1fffffe8 characters #10

@jakub-g

Description

@jakub-g

In our monorepo, we have 25k+ TS files, this leads to types.json weighing 700MB+ (trace.json is ~40MB).

It seems that readFile has a limit if 512 MB (0x1fffffe8 characters).

try {
const json = await fs.promises.readFile(typesPath, { encoding: "utf-8" });
typesCache = JSON.parse(json);
}
catch (e) {
console.error(`Error reading types file: ${e.message}`);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions