Skip to content

Conversation

@merceyz
Copy link
Member

@merceyz merceyz commented Nov 1, 2023

What's the problem this PR addresses?

Workspace.getRecursiveWorkspaceChildren throws Range Error: Maximum call stack size exceeded when it encounters a workspace more than once.

Fixes #5799

How did you fix it?

Use a Set to keep track of the workspaces that have been found.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Copy link
Member

@RDIL RDIL left a comment

Choose a reason for hiding this comment

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

Nice fix! Looks good to me.

@arcanis arcanis merged commit 32979f3 into master Nov 1, 2023
@arcanis arcanis deleted the merceyz/fix/self-referencing-workspaces-field branch November 1, 2023 21:45
merceyz added a commit that referenced this pull request Nov 1, 2023
**What's the problem this PR addresses?**

`Workspace.getRecursiveWorkspaceChildren` throws `Range Error: Maximum
call stack size exceeded` when it encounters a workspace more than once.

Fixes #5799

**How did you fix it?**

Use a `Set` to keep track of the workspaces that have been found.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

(cherry picked from commit 32979f3)
merceyz added a commit that referenced this pull request Nov 13, 2023
**What's the problem this PR addresses?**

`Workspace.getRecursiveWorkspaceChildren` throws `Range Error: Maximum
call stack size exceeded` when it encounters a workspace more than once.

Fixes #5799

**How did you fix it?**

Use a `Set` to keep track of the workspaces that have been found.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

(cherry picked from commit 32979f3)
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.

[Bug?]: getRecursiveWorkspaceChildren: Range Error: Maximum call stack size exceeded

4 participants