fix: don't log an error for vite configs without a Svelte plugin - #3091
Merged
dummdidumm merged 1 commit intoAug 12, 2026
Conversation
Since 4.6.0 the config loader crawls for `vite.config.*` files. In a monorepo
it also visits packages that don't use Svelte at all, and for those it logged
Error while loading config at .../packages/package-a/vite.config.ts
Error: No Svelte configuration found in vite config. Is @sveltejs/vite-plugin-svelte configured?
even though nothing was wrong. `loadConfig` already distinguishes the two
cases: a config that fails to load comes back with an `error`, while a config
that loads fine but has no Svelte plugin comes back as `undefined`. Only the
former is an actual error, so only that one is logged as such now. The latter
is logged at the normal level instead.
Behaviour is otherwise unchanged: the fallback preprocessor and
`loadConfigError` are still set exactly as before, so retry and diagnostics
logic keeps working.
🦋 Changeset detectedLatest commit: d49eefd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Merged
renovate Bot
added a commit
to gwennlbh/svelte-mathml
that referenced
this pull request
Aug 20, 2026
##### [v4.7.6](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.6) ##### Patch Changes - fix: don't log an error for vite configs without a Svelte plugin ([#3091](sveltejs/language-tools#3091)) - fix: handle SvelteKit 3 having its config merged at the top level ([#3104](sveltejs/language-tools#3104)) ##### [v4.7.5](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.5) ##### Patch Changes - fix: prevent silent error during start-up caused by unhandled promise ([#3096](sveltejs/language-tools#3096)) - Updated dependencies \[[`1df53d8`](sveltejs/language-tools@1df53d8)]: - [@sveltejs/load-config](https://github.com/sveltejs/load-config)@0.2.2 ##### [v4.7.4](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.4) ##### Patch Changes - fix: support TypeScript 7 Stable under npm alias ([#3073](sveltejs/language-tools#3073)) ##### [v4.7.3](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.3) ##### Patch Changes - feat: zero-config `+error.svelte` props ([#3076](sveltejs/language-tools#3076)) ##### [v4.7.2](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.2) ##### Patch Changes - fix: resolve tsgo bin path with package.json ([#3074](sveltejs/language-tools#3074)) - fix: report tsconfig errors in --tsgo-experimental-api ([#3070](sveltejs/language-tools#3070)) ##### [v4.7.1](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.1) ##### Patch Changes - fix: correctly parse --tsgo-experimental-api flag ([#3067](sveltejs/language-tools#3067)) ##### [v4.7.0](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.0) ##### Minor Changes - feat: add `--config` option ([#3066](sveltejs/language-tools#3066)) - feat: svelte-check tsgo support with experimental api ([#3036](sveltejs/language-tools#3036)) ##### Patch Changes - fix: load esm version of Vite ([#3065](sveltejs/language-tools#3065)) - fix: stop excluding workspaces under dot-prefixed ancestors ([#3037](sveltejs/language-tools#3037)) - Updated dependencies \[[`7a3464b`](sveltejs/language-tools@7a3464b), [`a2561fc`](sveltejs/language-tools@a2561fc)]: - [@sveltejs/load-config](https://github.com/sveltejs/load-config)@0.2.0 ##### [v4.6.0](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.6.0) ##### Minor Changes - feat: support reading Svelte config from `vite.config.js/ts` ([#3031](sveltejs/language-tools#3031)) ##### Patch Changes - Updated dependencies \[[`151cf45`](sveltejs/language-tools@151cf45)]: - [@sveltejs/load-config](https://github.com/sveltejs/load-config)@0.1.1 ##### [v4.5.0](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.5.0) ##### Minor Changes - feat: support Svelte 5 declaration tags ([#3033](sveltejs/language-tools#3033)) ##### Patch Changes - fix: properly handle props with the name `slot` inside Svelte 5 snippets ([#3030](sveltejs/language-tools#3030)) - feat: add support for svelte config ts/mts files ([#3009](sveltejs/language-tools#3009)) ##### [v4.4.8](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.8) ##### Patch Changes - feat: typescript 6.0 support ([#2985](sveltejs/language-tools#2985)) ##### [v4.4.7](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.7) ##### Patch Changes - fix: flush stdout/stderr before exit ([#3014](sveltejs/language-tools#3014)) - fix: report diagnostics in tsconfig.json ([#3005](sveltejs/language-tools#3005)) ##### [v4.4.6](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.6) ##### Patch Changes - fix: prevent config loading message in svelte-check --incremental ([#2974](sveltejs/language-tools#2974)) - fix: resolve svelte files with NodeNext in --incremental/tsgo ([#2990](sveltejs/language-tools#2990)) - perf: various optimization with ast walk ([#2969](sveltejs/language-tools#2969)) - fix: prevent error with escape sequence in attribute ([#2968](sveltejs/language-tools#2968)) - fix: typescript 6.0 compatibility ([#2988](sveltejs/language-tools#2988)) ##### [v4.4.5](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.5) ##### Patch Changes - fix: use Promise<Response> for async kit handler return types ([#2966](sveltejs/language-tools#2966)) ##### [v4.4.4](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.4) ##### Patch Changes - fix: more robust detection of `lang="ts"` attribute ([#2957](sveltejs/language-tools#2957)) - fix: pass filename to `warningFilter` ([#2959](sveltejs/language-tools#2959)) - fix: resolve svelte files under path alias in `--incremental/tsgo` mode ([#2955](sveltejs/language-tools#2955)) ##### [v4.4.3](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.3) ##### Patch Changes - fix: respect `@ts-ignore` etc comments within tags ([#2950](sveltejs/language-tools#2950)) ##### [v4.4.2](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.2) ##### Patch Changes - fix: resolve shims correctly in `--incremental/tsgo` mode ([`cd1ff2f`](sveltejs/language-tools@cd1ff2f)) - fix: include `references` in generated `tsconfig.json` in `--incremental/tsgo` mode ([`1990f74`](sveltejs/language-tools@1990f74)) ##### [v4.4.1](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.1) ##### Patch Changes - fix: handle relative imports reaching outside working directory when using `--incremental/--tsgo` flags ([#2942](sveltejs/language-tools#2942)) - fix: support SvelteKit zero types in svelte-check --incremental ([#2939](sveltejs/language-tools#2939)) ##### [v4.4.0](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.4.0) ##### Minor Changes - feat: provide `--incremental` and `--tsgo` flags ([#2932](sveltejs/language-tools#2932)) ##### Patch Changes - fix: ignore Unix domain sockets in file watcher to prevent crashes ([#2931](sveltejs/language-tools#2931)) - fix: properly use machine output by default for Claude Code ([`e9f58d2`](sveltejs/language-tools@e9f58d2)) ##### [v4.3.6](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.3.6) ##### Patch Changes - fix: don't hoist type/snippet referencing $store ([#2926](sveltejs/language-tools#2926))
gwennlbh
pushed a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 31, 2026
##### [v4.7.6](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.6) ##### Patch Changes - fix: don't log an error for vite configs without a Svelte plugin ([#3091](sveltejs/language-tools#3091)) - fix: handle SvelteKit 3 having its config merged at the top level ([#3104](sveltejs/language-tools#3104)) ##### [v4.7.5](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.5) ##### Patch Changes - fix: prevent silent error during start-up caused by unhandled promise ([#3096](sveltejs/language-tools#3096)) - Updated dependencies \[[`1df53d8`](sveltejs/language-tools@1df53d8)]: - [@sveltejs/load-config](https://github.com/sveltejs/load-config)@0.2.2 ##### [v4.7.4](https://github.com/sveltejs/language-tools/releases/tag/svelte-check%404.7.4) ##### Patch Changes - fix: support TypeScript 7 Stable under npm alias ([#3073](sveltejs/language-tools#3073)) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
Partially addresses #3080.
What this fixes
Since 4.6.0 the config loader crawls for
vite.config.*files. In a monorepo that means it also visits packages which don't use Svelte at all, and for each of those it logs an error:package-anot using Svelte isn't a problem, so reporting it as an error is misleading — the reporter in #3080 hit exactly this.loadConfigalready distinguishes the two cases, it just wasn't being used to: a config that genuinely fails to load comes back as{ error, ... }, while a config that loads fine but has no Svelte plugin falls through and comes back asundefined. Only the first is an error. This checksresult?.errorand keepsLogger.errorfor that case, logging the other at the normal level.Everything else is deliberately untouched. The fallback preprocessor and
loadConfigErrorare still set exactly as before, so the retry logic inloadConfigs(!config || config.loadConfigError),addFallbackConfig, and the diagnostics path ingetDiagnostics.tsall behave identically. This is only about the log level.What this does not fix
#3080 raises a second, larger question: how
svelte-checkshould work in a monorepo with several Svelte packages, each with its ownvite.config.ts, when--configtakes a single path. That's a design question about--config/ExplicitConfigScoperather than a bug, so I left it alone — happy to follow up if you decide on a direction.Verification
Two tests added, both driven from the actual behaviour rather than written to match the patch:
main(Logger.erroris called with the "No Svelte configuration found in vite config" message), passes with the fix.The second test builds
ConfigLoaderdirectly rather than through thecreateConfigLoaderhelper, because that helper always wraps its result in{ config }and so can't express a failed load. I found that out by tracing what the mock actually returned — my first attempt at the test passed for the wrong reason.Checks run locally on Node 22:
configLoader.test.ts: 15 passing.svelte-language-serversuite: 819 passing, 21 pending, 3 failing — all three inSvelteCheckTSGoDiagnosticsProvider. Those also fail on a cleanmain(5 failing there, the set moves between runs), so they're pre-existing and unrelated to this change.prettier --checkclean on the touched files,tsc --noEmitexits 0.Changeset included.
Written with Claude Code (Claude Opus 5); I reviewed and tested everything before submitting.