Skip to content

Conversation

@glennreyes
Copy link

@glennreyes glennreyes commented Oct 11, 2025

Summary

  • normalize the preview root so every dependency resolves from the right starting point
  • hush the missing index/file warnings whenever an import steps outside the email directory
  • add a regression test to keep the preview logs calm from now on

Preview/logs should feel much friendlier/be less verbose after this. Fixes #2419.

Testing

  • pnpm --filter react-email test

Summary by cubic

Reduce noisy React Email preview logs by normalizing the preview root and suppressing missing-file/index warnings for imports outside the email directory. Keeps hot reload logs clean while still warning for real issues inside the email folder. Fixes #2419.

  • Bug Fixes
    • Normalize preview root so dependency resolution is consistent.
    • Warn only for missing files/indices inside the email directory; suppress for external paths.
    • Add regression test to prevent warning regressions.

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2025

⚠️ No Changeset found

Latest commit: 314323c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Oct 11, 2025

@glennreyes is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 11, 2025

Open in StackBlitz

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

commit: 314323c

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts">

<violation number="1" location="packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts:148">
Rule violated: **No `should` in tests**

Test descriptions must avoid the term “should” to stay declarative (per the No `should` in tests guideline). Please rephrase this description accordingly.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

pathToDependencyFromDirectory,
)
) {
console.warn(
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced that we should only warn when inside the emails directory. Why would it be a problem inside it, but not ouside it?

`Could not find file at ${pathToDependencyFromDirectory}`,
);
if (
isInsideDirectory(
Copy link
Member

Choose a reason for hiding this comment

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

I think this error should be fine as it was, right? This happens if the import's target file can't be found, not a directory

'utf8',
);

const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
Copy link
Member

Choose a reason for hiding this comment

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

I don't like testing for warnings like this very much, I'd rather test the parts that are tricky to maintain and/or are critical to users

@glennreyes glennreyes force-pushed the fix-preview-server-suppress-external-logs branch from 2602094 to 314323c Compare October 16, 2025 15:23
@gabrielmfern gabrielmfern force-pushed the canary branch 4 times, most recently from 7da803f to e9af285 Compare October 24, 2025 12:33
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.

Unexpected logging for dev server

2 participants