Skip to content

fix: fix browser usage#749

Open
altano wants to merge 3 commits intovercel:mainfrom
altano:fix-browser-usage
Open

fix: fix browser usage#749
altano wants to merge 3 commits intovercel:mainfrom
altano:fix-browser-usage

Conversation

@altano
Copy link
Copy Markdown

@altano altano commented Apr 7, 2026

Fix browser usage

Fixes #738

Satori broke in browsers in v0.18.0 due to process.env references in src/yoga.ts. This PR fixes that and adds browser tests to prevent regression.

Changes

  • Fix process.env in browser — remove Node-specific environment checks from the yoga loader so satori works in browsers without polyfills
  • Add browser tests (local and CI) — vitest + playwright runs satori in real chromium/firefox/webkit
  • Upgrade vitest — 0.32.0 → 4.1.2 (snapshot paths changed but images are identical)

Notes

  • In the future more browser tests can be added. They must have a .browser-test.tsx extension to get picked up by the browser specific vitest.
  • The vitest upgrade was huge but seemed to work perfectly so seems fine.
  • I added the browser tests to the CI workflow but I obviously can't test that without submitting a PR, so that might be broken. I'll fix it if so, after workflow run permissions are granted. If a repo maintainer can help me with that all the better.

altano added 3 commits April 7, 2026 01:09
This is a major version upgrade from 0.32.0 to 4.1.2. Note that the snapshot paths changed but were otherwise identical.
Use vitest + playwright to test satori in a browser. Satori used to work perfectly in browsers but broke in v0.18.0 (vercel#738). If we're going to fix it, we should have a test to make sure it doesn't regress again.

This test is extremely simple and minimally exercises satori, but should catch basic issues.
Fixes vercel#738 and restores satori's ability to run in a browser unmodified.
@altano altano requested a review from shuding as a code owner April 7, 2026 08:17
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
satori-playground Ready Ready Preview, Comment, Open in v0 Apr 7, 2026 8:18am

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedesbuild@​0.16.17 ⏵ 0.28.091100 +273 +194100
Updated@​vitest/​ui@​0.32.0 ⏵ 4.1.299 +110075 -398 +1100
Updatedvitest@​0.32.0 ⏵ 4.1.296 +110079 +198 +1100
Updated@​vitest/​coverage-v8@​0.32.0 ⏵ 4.1.299 +110079 +1298 +1100
Added@​types/​node@​25.5.21001008196100
Addedreact@​18.2.01001008497100
Added@​vitest/​browser-playwright@​4.1.2991008698100
Added@​testing-library/​dom@​10.4.19910010087100
Addedplaywright@​1.59.110010010099100

View full report

@altano altano changed the title Fix browser usage fix: fix browser usage Apr 7, 2026
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.

satori no longer runs in browser

1 participant