Skip to content

svelte: Disable paths.relative for Playwright tests#13521

Merged
Turbo87 merged 1 commit into
rust-lang:mainfrom
Turbo87:sv-percy-paths-relative
Apr 28, 2026
Merged

svelte: Disable paths.relative for Playwright tests#13521
Turbo87 merged 1 commit into
rust-lang:mainfrom
Turbo87:sv-percy-paths-relative

Conversation

@Turbo87
Copy link
Copy Markdown
Member

@Turbo87 Turbo87 commented Apr 28, 2026

SvelteKit 2.58.0 (sveltejs/kit#15718) emits root-layout stylesheets in the server HTML to fix FOUC. With paths.relative: true (the default), those hrefs are relative to the request URL. Percy preserves the attribute strings verbatim and renders the snapshot at its own URL, so the relative hrefs no longer resolve and the snapshot comes out unstyled.

Setting paths.relative: false under PLAYWRIGHT=1 keeps Percy snapshots stable. The default applies in production and Vitest builds.

Discovered while running #13373.

Related

SvelteKit 2.58.0 (sveltejs/kit#15718) emits root-layout stylesheets
in the server HTML to avoid a flash of unstyled content. With
`paths.relative: true` (the default), those hrefs are relative to
the request URL. Percy preserves the attribute strings verbatim and
renders the snapshot at a different URL, so the relative hrefs no
longer resolve and the snapshot comes out unstyled.

Force absolute paths under `PLAYWRIGHT=1` to keep Percy snapshots
stable.
@Turbo87 Turbo87 added the C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear label Apr 28, 2026
@Turbo87 Turbo87 merged commit 6933d8d into rust-lang:main Apr 28, 2026
13 checks passed
@Turbo87 Turbo87 deleted the sv-percy-paths-relative branch April 28, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-svelte C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants