Skip to content

RangeError if too many files in directory tree #921

@kmdavis

Description

@kmdavis

If the number of (nested) files in a subfolder exceeds 64k, file.getFilteredFileList throws an error at https://github.com/requirejs/r.js/blob/master/build/jslib/node/file.js#L131

{ [Error: RangeError: Maximum call stack size exceeded]
  originalError: [RangeError: Maximum call stack size exceeded] }

We encountered this after adding several new libraries to node_modules, resulting in an attempt to push 140k dirFiles onto the files array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions