Skip to content

fix(render): strip image preload links with imagesrcset or imagesizes when as=image is omitted - #3754

Closed
Tyagiquamar wants to merge 1 commit into
resend:canaryfrom
Tyagiquamar:fix-strip-image-preload-imagesrcset
Closed

Tyagiquamar wants to merge 1 commit into
resend:canaryfrom
Tyagiquamar:fix-strip-image-preload-imagesrcset

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3753.

React 19 can emit image preload hints that carry imagesrcset/imagesizes without an as=image attribute. stripImagePreloadLinks only removed preloads with as=image, so these tags survived into the rendered email HTML even though email clients ignore link rel=preload.

This widens isImagePreloadLink to also strip preload links carrying imagesrcset or imagesizes attributes. Non-image preloads (as=style, as=font) and other link tags are still kept, covered by the existing tests.

Verification: added a regression test (fails before the fix, passes after); full @react-email/render suite passes (9/9 in the touched spec; the only full-suite failure observed was a flaky pretty.spec.ts timeout that passes in isolation).

Note: this supersedes #3743, which was closed for targeting main, missing an issue, and containing an unrelated commit. This submission follows the requested flow: issue #3753 first, clean branch from current upstream canary containing only this fix.


Summary by cubic

Strips image preload links that carry imagesrcset or imagesizes even when as="image" is omitted, so React 19 responsive-image hints no longer leak into rendered email HTML. Closes #3753. Non-image preloads like as="style" and as="font" are still kept.

Written for commit 17e3d5f. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 17e3d5f

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/render 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

@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@felipefreitag

Copy link
Copy Markdown
Member

I could not reproduce the issue, so I am closing this PR. The details are in #3753.

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

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render: image preload links with imagesrcset or imagesizes survive stripping when as=image is omitted

2 participants