fix(vite-config): bridge the duplicate-vite Plugin type so svelte-check passes#2151
Merged
Conversation
…ck passes
The lockfile and root overrides already pin one vite@7.3.5, but bun materializes
peer-variant copies on disk (vite@7.3.5, vite@7.3.5+<hash>, ...). A consuming
app's @sveltejs/kit resolves one variant while @epicenter/vite-config resolves
another, so their Plugin / PluginOption types are nominally unrelated and
svelte-check rejects the plugins array against this package's UserConfig
("Type 'Plugin<any>[]' is not assignable to type 'PluginOption'... Two different
types with this name exist, but they are unrelated.").
Only one vite runs at runtime; bridge the array to this package's own plugin
type so type resolution lines up. This unblocks svelte-check for every workspace
Svelte app (opensidian and vocab go from one error to zero).
Contributor
Preview Deployment
These previews update automatically with new commits to this PR. Commit 8484b94 |
Leftium
pushed a commit
to Leftium/epicenter
that referenced
this pull request
Jun 23, 2026
The isolated install now resolves a single `vite` peer-variant (`vite@7.3.5+9df36cbd11bbdf29`) that every package symlinks to: the apps, @sveltejs/kit, @tailwindcss/vite, and @epicenter/vite-config alike. With one physical `vite`, there is one `Plugin` type, so the plugin array already matches `UserConfig['plugins']` and the cast added in EpicenterHQ#2151 is dead weight. svelte-check passes with 0 errors across all nine vite-config consumers after removing the cast from the shared helper and the three standalone configs (matter, api/ui, skills). The bun peer-variant count is computed at install time rather than pinned in the lockfile, so a future graph or bun-version change could re-split `vite`; the helper comment now records that and points at the single place to restore the cast if the clash returns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lockfile and root
overridesalready pin onevite@7.3.5, but bun materializes peer-variant copies on disk (.bun/vite@7.3.5,vite@7.3.5+4ece0cffe9718641,vite@7.3.5+682e14911fb7da75). A consuming app's@sveltejs/kitresolves the+4ecevariant while@epicenter/vite-configresolves the plain one, so theirPlugin/PluginOptiontypes are nominally unrelated:svelte-checkhit this onpackages/vite-config/src/index.ts:21in every workspace Svelte app. Only one vite runs at runtime, so the cast bridges the array to this package's own plugin type and type resolution lines up.opensidianandvocabboth go from one error to zero.This is separate from #2140 (which pins the bun linker to
isolatedfor layout determinism): peer-variant copies persist under both linkers, so #2140 makes the layout deterministic without collapsing this particular type clash. This is the targeted fix.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.