Skip to content

fix: resolve config paths only after we have root - #16229

Merged
Rich-Harris merged 19 commits into
version-3from
fix-resolve-root
Jul 6, 2026
Merged

Rich-Harris merged 19 commits into
version-3from
fix-resolve-root

Conversation

@teemingc

@teemingc teemingc commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

This PR separates the config processing from the validation because the processing needs to happen after we've retrieved the Vite root value. This is important for proper monorepo support. Otherwise, tooling such as our language tools and Vitest end up resolving file paths relative to where the process started rather than relative to the project root


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

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.

@pkg-svelte-dev

ghost commented Jul 3, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 5f92e23:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/5f92e2325e077b157b274feb9090a3a956ba1d5b

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16229

@changeset-bot

ghost commented Jul 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5f92e23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@svelte-docs-bot

ghost commented Jul 3, 2026

Copy link
Copy Markdown

Comment thread packages/kit/src/exports/vite/index.js Resolved
Comment thread packages/kit/src/core/config/index.js Resolved
@teemingc
teemingc marked this pull request as draft July 3, 2026 17:01
@teemingc
teemingc marked this pull request as ready for review July 5, 2026 09:34

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

Leftover console.log({ service_worker_entry_file, id }) in the service-worker env plugin's transform hook spams the console for every transformed client module.

Fix on Vercel

… service-worker env plugin's `transform` hook spams the console for every transformed client module.

This commit fixes the issue reported at packages/kit/src/exports/vite/index.js:1167

## Bug

In `packages/kit/src/exports/vite/index.js`, the `transform` hook of `plugin_service_worker_env` began with a debugging leftover:

```js
transform(code, id) {
    console.log({ service_worker_entry_file, id });
    if (id !== service_worker_entry_file) return;
    ...
}
```

The `console.log` is placed **before** the `id !== service_worker_entry_file` early return, so it executes for *every* module transformed in the client environment whenever a service worker entry file exists.

### Trigger

Any SvelteKit project that has a service worker (`src/service-worker.js` or similar). During dev and build, the client environment transforms many modules, and each call logs `{ service_worker_entry_file, id }`, flooding the console with internal path data.

## Fix

Removed the stray `console.log` line. The remaining `console.log` statements elsewhere in the file are intentional user-facing messages; this one dumped internal variables and was clearly accidental debug output.


Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: teemingc <[email protected]>
@Rich-Harris
Rich-Harris merged commit a248c9b into version-3 Jul 6, 2026
@Rich-Harris
Rich-Harris deleted the fix-resolve-root branch July 6, 2026 18:18
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.

2 participants