Skip to content

Can't create array larger than 2**26 items #58197

Open
@julienp

Description

@julienp

Version

v24.0.0

Platform

Darwin macbook-pulumi.local 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6030 arm64

Subsystem

No response

What steps will reproduce the bug?

Works:

Array.from("a".repeat(2**26))

Fails:

Array.from("a".repeat(2**26+1))
Uncaught RangeError: Invalid array length
    at Array.from (<anonymous>)

In v22.15.0 this works fine.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

It should be possible to create arrays with 2**32 elements.

What do you see instead?

RangeError: Invalid array length

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    v24.xv24.x v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions