Skip to content

Conversation

@dominikg
Copy link
Member

@dominikg dominikg commented Jan 26, 2026

this allows us to test with different vite majors


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

⚠️ No Changeset found

Latest commit: 07365e1

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

@benmccann
Copy link
Member

Looks like this is failing the CI:

Run yq -i '. + {overrides: .catalogs."vite-beta"}' pnpm-workspace.yaml
Error: 1:6: lexer: invalid input text "overrides: .cata..."
Error: Process completed with exit code 1.

But happy to merge it once it's passing

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Something seems to still be freaking out, looks like a broken lockfile replacement maybe?

@dominikg
Copy link
Member Author

the baseline test passed locally for me using node18, not sure what difference CI makes here.
the beta test failed on different tests the app where it failed here passed.

@dominikg dominikg force-pushed the chore/test-matrix-vite branch from 2557112 to 710e60a Compare January 28, 2026 10:49
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'baseline'
Copy link
Member Author

Choose a reason for hiding this comment

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

introduces a new matrix dimension called vite with 3 values

baseline: the lowest version of vite we support (peer range of sveltekit)
current: the version of vite currently in the lockfile
beta: the upcoming beta version of vite

- name: setup overrides for matrix.vite
if: matrix.vite != 'current'
run: | # copies catalogs.vite-xxx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."vite-${{matrix.vite}}"' pnpm-workspace.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

yq is available on github hosted runners (except windows) and allows in place editing of yaml

this code copies a block of catalogs.vite-baseline into overrides so tha the install that we run afterwards enforces these versions. see pnpm-workspace.yaml for details

matrix:
include:
- node-version: 18
- node-version: 24
Copy link
Member Author

Choose a reason for hiding this comment

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

node 18 caused build fails with newer versions of vite-plugin-svelte@6 that uses node:util styleText.

these tests are for browser behavior so i think its ok to update to 24 which should make them a bit more efficient (24 is faster than 18)
same goes for vite6

- name: setup overrides for matrix.node
if: matrix.node-version == 18
run: | # copies catalogs.node-xx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."node-18"' pnpm-workspace.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

similar to vite-baseline we have to pick versions that support node18 here otherwise it can break.

@@ -1,5 +1,5 @@
<script>
import { get_event } from './data.remote.js';
import { get_event } from './data.remote.ts';
Copy link
Member Author

Choose a reason for hiding this comment

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

concession change for vite5, it doesn't work with data.remote.js on node 18, allowing .ts import and changing the imported suffix works.

const cwd = path.join(directories, dir);

if (!fs.existsSync('svelte.config.js')) {
if (!fs.existsSync(path.join(cwd,'svelte.config.js'))) {
Copy link
Member Author

@dominikg dominikg Jan 28, 2026

Choose a reason for hiding this comment

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

without this, sync-all does nothing which caused one test with vite8 to fail because rolldown does not like missing .svelte-kit/tsconfig.json

Copy link
Member Author

Choose a reason for hiding this comment

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

the missing tsconfig causing an error has been fixed in latest vite8 beta, but this fix to sync-all should still be done

@dominikg
Copy link
Member Author

one thing i havn't fully wrapped my head around yet is if these overrides could lead to dependency cache poisoning. that could happen if pnpm action pruned unused vite from the cached pnpm store and a test with these overrides finished first and gets to write it.

@teemingc teemingc added the vite label Feb 4, 2026
@teemingc
Copy link
Member

teemingc commented Feb 4, 2026

Seems like one of the CI checks is failing consistently. Something about $app/read not working.

@dominikg
Copy link
Member Author

dominikg commented Feb 4, 2026

it's been passing for me locally so i kind of have a hard time reproducing/analyzing it. might have to download the playwright trace and go from there. If anyone can replicate by using node18 an the overrides from the baseline catalog please help :)

port: process.env.DEV ? 5173 : 4173
},
retries: process.env.CI ? 2 : 0,
retries: 2, // some tests are flaky especially on overloaded systems, so allow retry
Copy link
Member

Choose a reason for hiding this comment

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

I preferred it failing locally as it was easier to see what was going wrong and gave more incentive to fix it

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure that incentive is working then because they failed on me without any changes from main more often than not.

Copy link
Member Author

Choose a reason for hiding this comment

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

@benmccann i can change it to

/**
 * @param {string} name
 * @param {number} default_value
 * @return {number}
 */
function number_from_env(name,default_value) {
	return ( process.env[name] != null) ? Number(process.env[name]) : default_value
}
/* ...*/
	retries: process.env.CI ? 2 : number_from_env('SVELTEKIT_PLAYWRIGHT_RETRIES',0),
	

so you could run it with SVELTEKIT_PLAYWRIGHT_RETRIES=2 pnpm test:kit locally but default would still be no retries

Copy link
Member Author

Choose a reason for hiding this comment

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

same for the workers change

Copy link
Member

Choose a reason for hiding this comment

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

that works for me

Copy link
Member Author

Choose a reason for hiding this comment

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

added KIT_E2E_WORKERS and KIT_E2E_RETRIES (we already had KIT_E2E_BROWSER) in all configs and a shared util to read number from env

the util lives somewhat awkwardly in the root, but i didn't want to introduce a workspace package. If anyone has ideas how to better share it or if it should be inlined into the 4 files thats fine with me too

@dominikg
Copy link
Member Author

dominikg commented Feb 5, 2026

one thing i havn't fully wrapped my head around yet is if these overrides could lead to dependency cache poisoning. that could happen if pnpm action pruned unused vite from the cached pnpm store and a test with these overrides finished first and gets to write it.

we are using the cache feature of actions/setup-node which caches the pnpm store and not just local node_modules and it does not prune, so no poisoning here actions/setup-node#1428 (also searched their code, they don't)

These tests are also slower than others that use the cache with the same key so they are very unlikely to succeed in trying to store it.

If we still feel this is too risky, we'd have to disable caching on setup-node if vite dimension is not current

Copy link
Member

@teemingc teemingc left a comment

Choose a reason for hiding this comment

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

Thank you!

@teemingc teemingc merged commit 2f3a007 into main Feb 11, 2026
26 checks passed
@teemingc teemingc deleted the chore/test-matrix-vite branch February 11, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants