Skip to content

Code size limit bump (#4965) in babel-generator causes issues for very large files #5081

@DrewML

Description

@DrewML

Report (copy/paste from comment by @DmitriiAbramov):

this change resulted in some issues in one of my builds.
I have a relatively large file that i'm instrumenting with babel-plugin-istanbul(length 141415)

with this limit being raised to 500000 my babel process gets stuck on 100% and never exits.

i was able to track it and the last babel line of code that gets frozen is this https://github.com/babel/babel/blob/master/packages/babel-generator/src/buffer.js#L43

after that it leaves babel and goes into lodash code (https://github.com/lodash/lodash/blob/master/trimEnd.js#L32)
where the process gets stuck on string.replace() call that seems to be not able to process such a big string (string length here is 6449484)

reverting this change solves the issue. Is there any way to configure it or can it be reverted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRi: discussionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions