Skip to content

fix: properly handle cyclic nodes with getParentClientNodes#14522

Merged
markdalgleish merged 5 commits intoremix-run:devfrom
BlankParticle:fix/properly-handle-unique-nodes
Dec 18, 2025
Merged

fix: properly handle cyclic nodes with getParentClientNodes#14522
markdalgleish merged 5 commits intoremix-run:devfrom
BlankParticle:fix/properly-handle-unique-nodes

Conversation

@BlankParticle
Copy link
Contributor

@BlankParticle BlankParticle commented Nov 10, 2025

getParentClientNodes recursively goes through and figures out the module graph, but there is no protection against import cycles in the traversal, which leads to max Callstack errors everytime a file within the cycle is changed

import cycles are obvisouly not a good thing, I have tried to figure out the cyclic import but has been unable to find it. I have tried https://github.com/sverweij/dependency-cruiser but it was unable to find anything. so I did some debuging and found that the cycle involves virtual:cloudflare/worker-entry, which makes it way harder to detect as its a virtual module. so I am still unable to figure out the issue.

Which is why I just fixed the function to keep track of seen modules, this also removes the need of extra uniqueModule function which make this slightly better

fixes #14670

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: a7f8e4a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Nov 10, 2025

Hi @BlankParticle,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Nov 10, 2025

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@BlankParticle
Copy link
Contributor Author

@brophdawg11 hey It has been a long time since I made this PR, I was wondering if anyone can checkout the PR?

@brophdawg11
Copy link
Contributor

Can you open an issue with a minimal reproduction we could use as an example to evaluate the fix?

@BlankParticle
Copy link
Contributor Author

took some time to figure out how to best reprod it
made #14670

Copy link
Member

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@markdalgleish markdalgleish merged commit 7ad6853 into remix-run:dev Dec 18, 2025
9 checks passed
@BlankParticle BlankParticle deleted the fix/properly-handle-unique-nodes branch December 18, 2025 07:10
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🤖 Hello there,

We just published version 7.12.0-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

🤖 Hello there,

We just published version 7.12.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants