Skip to content

Fix maximum call stack size error #2027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Serious-senpai
Copy link

When a great number of files matching a glob pattern, the line

stack.push(...childItems.reverse())

raises Error: Maximum call stack size exceeded. This can be fixed by pushing items to the array manually.

@Copilot Copilot AI review requested due to automatic review settings April 16, 2025 04:24
@Serious-senpai Serious-senpai requested a review from a team as a code owner April 16, 2025 04:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/glob/src/internal-globber.ts:149

  • The variable 'childItems' now holds file name strings rather than SearchState objects. Consider renaming it to 'childFileNames' for clarity.
const childItems = await fs.promises.readdir(item.path)

Copy link

@LinuxSuRen LinuxSuRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants