Skip to content

fix(react-email): hot reloading with circular dependencies #2315

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 11 commits into
base: main
Choose a base branch
from

Conversation

gabrielmfern
Copy link
Collaborator

@gabrielmfern gabrielmfern commented Jun 24, 2025

Meant for #2304. The initial error there was the same as #1872, which has been fixed, but their reproduction also points out that circular dependencies end up reaching the maximum call stack size due to an infinite loop. The problem was specifically when trying to recursively resolve the dependents of a module, which would go on forever due to circular dependencies.

This pull request introduces a more stable way to, now iteratively, resolve dependents of a module without breaking with these use cases. It also refactors the tests we had for createDependencyGraph to use a specific testing directory for this, which also now tests the use case of circular dependencies to avoid regression on this.

@gabrielmfern gabrielmfern self-assigned this Jun 24, 2025
@gabrielmfern gabrielmfern added the Package: react-email This is the CLI we generally use as just `email` on the temrinal. label Jun 24, 2025
Copy link

changeset-bot bot commented Jun 24, 2025

🦋 Changeset detected

Latest commit: 38fa921

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

This PR includes changesets to release 1 package
Name Type
react-email 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

Copy link

vercel bot commented Jun 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 7:42pm
react-email-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 7:42pm

Copy link

pkg-pr-new bot commented Jun 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email@2315

commit: 38fa921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant