Repository: sveltejs/kit
Pull request #8258 (2022-12-25 19:21:40)

create-svelte TypeScript project should use vite.config.ts instead of vite.config.js
## Description

Hello !

I opened this PR regarding the issue https://github.com/sveltejs/kit/issues/8257, for TypeScript projects, it makes sense to generate vite.config.ts files. This PR is a very tiny quality of life improvement for TypeScript users but doesn't change anything in a functional way.

By default, the vite command will look for vite.config.js or vite.config.ts file.

I took this issue even though it's probaby not "required" in the project right now, but it allows me to get started with a simple task first on the SvelteKit Repository.

### Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [x] 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
- [x] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check`

### Changesets
- [x] 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. All changesets should be `patch` until SvelteKit 1.0


changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 17a79587e8ce28fb9225d8fd96071a75f2401dc2

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.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/AmFlint/sveltekit/new/vite-config-ts?filename=.changeset/heavy-dancers-walk.md&value=---%0A%22create-svelte%22%3A%20patch%0A---%0A%0Aenhance%3A%20svelte%20create%20typescript%20project%20use%20vite.config.ts%0A)


AmFlint: Test failures on macos and webkit seems unrelated to this PR

Patch:
diff --git a/.changeset/chilly-maps-worry.md b/.changeset/chilly-maps-worry.md
deleted file mode 100644
index c8c1a5a53..000000000
--- a/.changeset/chilly-maps-worry.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/adapter-cloudflare-workers': patch
----
-
-[chore] update @cloudflare/kv-asset-handler
diff --git a/.changeset/famous-emus-leave.md b/.changeset/famous-emus-leave.md
new file mode 100644
index 000000000..a7cbd520f
--- /dev/null
+++ b/.changeset/famous-emus-leave.md
@@ -0,0 +1,5 @@
+---
+'create-svelte': minor
+---
+
+Create vite.config.ts for TypeScript projects
diff --git a/.changeset/large-ravens-attack.md b/.changeset/large-ravens-attack.md
deleted file mode 100644
index 60cd95f58..000000000
--- a/.changeset/large-ravens-attack.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-"@sveltejs/adapter-node": patch
----
-
-Update dependency @rollup/plugin-json to v6
-
-Note: plugin-json v6 fails your build for parse errors that only logged a warning with v5. We consider this a bugfix as only healthy input should result in a successful build.
diff --git a/.changeset/quick-mice-hope.md b/.changeset/quick-mice-hope.md
deleted file mode 100644
index 05db2c29b..000000000
--- a/.changeset/quick-mice-hope.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/package': patch
----
-
-[chore] update svelte2tsx
diff --git a/.changeset/rare-frogs-crash.md b/.changeset/rare-frogs-crash.md
deleted file mode 100644
index cf0bec2f5..000000000
--- a/.changeset/rare-frogs-crash.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"create-svelte": patch
----
-
-[fix] address flakiness in playwright test
diff --git a/.changeset/sour-comics-dress.md b/.changeset/sour-comics-dress.md
deleted file mode 100644
index 58a76da84..000000000
--- a/.changeset/sour-comics-dress.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@sveltejs/adapter-node": patch
----
-
-chore(deps): update dependency @rollup/plugin-commonjs to v24
diff --git a/.changeset/tidy-pandas-report.md b/.changeset/tidy-pandas-report.md
deleted file mode 100644
index d328468ff..000000000
--- a/.changeset/tidy-pandas-report.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/kit': patch
----
-
-Fix form action redirect status code
diff --git a/.changeset/wise-adults-pull.md b/.changeset/wise-adults-pull.md
new file mode 100644
index 000000000..5bde68e01
--- /dev/null
+++ b/.changeset/wise-adults-pull.md
@@ -0,0 +1,5 @@
+---
+'@sveltejs/kit': patch
+---
+
+[fix] don't polyfill undici if using Deno or Bun
diff --git a/documentation/docs/10-getting-started/10-introduction.md b/documentation/docs/10-getting-started/10-introduction.md
index a6a447628..613adbab9 100644
--- a/documentation/docs/10-getting-started/10-introduction.md
+++ b/documentation/docs/10-getting-started/10-introduction.md
@@ -10,10 +10,16 @@ title: Introduction
 
 ## What is SvelteKit?
 
-SvelteKit is a framework for rapid development of robust, performant web applications.
+SvelteKit is a framework for rapidly developing robust, performant web applications using [Svelte](https://svelte.dev/).
 
-Building an app with all the modern best practices is fiendishly complicated. Those practices include [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations), so that you load only the minimal required code; [offline support](/docs/service-workers); [preloading](/docs/link-options#data-sveltekit-preload-data) pages before the user initiates navigation; [configurable rendering](/docs/page-options) that allows you to render your app [on the server](/docs/glossary#ssr) or [in the browser](/docs/glossary#csr-and-spa) at runtime or [at build-time](/docs/glossary#prerendering); and many other things. SvelteKit does all the boring stuff for you so that you can get on with the creative part.
+## What is Svelte?
 
-It uses [Vite](https://vitejs.dev/) with a [Svelte plugin](https://github.com/sveltejs/vite-plugin-svelte) to provide a lightning-fast and feature-rich development experience with [Hot Module Replacement (HMR)](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#hot), where changes to your code are reflected in the browser instantly.
+In short, Svelte is a way of writing user interface components — like a navigation bar, comment section, or contact form — that users see and interact with in their browsers. The Svelte compiler converts your components to JavaScript that can be run to render the HTML for the page and to CSS that styles the page. You don't need to know Svelte to understand the rest of this guide, but it will help. If you'd like to learn more, check out [the Svelte tutorial](https://svelte.dev/tutorial).
+
+## What does SvelteKit provide on top of Svelte?
+
+Svelte renders UI components. You can compose these components and render an entire page with just Svelte, but you need more than just Svelte to write an entire app.
 
-You don't need to know Svelte to understand the rest of this guide, but it will help. In short, it's a UI framework that compiles your components to highly optimized vanilla JavaScript. Read the [introduction to Svelte blog post](https://svelte.dev/blog/svelte-3-rethinking-reactivity) and the [Svelte tutorial](https://svelte.dev/tutorial) to learn more.
+SvelteKit provides basic functionality like a [router](/docs/glossary#routing) — which updates the UI when a link is clicked — and [server-side rendering (SSR)](/docs/glossary#ssr). But beyond that, building an app with all the modern best practices is fiendishly complicated. Those practices include [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations), so that you load only the minimal required code; [offline support](/docs/service-workers); [preloading](/docs/link-options#data-sveltekit-preload-data) pages before the user initiates navigation; [configurable rendering](/docs/page-options) that allows you to render different parts of your app on the server with [SSR](/docs/glossary#ssr), in the browser [client-side rendering](/docs/glossary#csr-and-spa), or at build-time with [prerendering](/docs/glossary#prerendering); and many other things. SvelteKit does all the boring stuff for you so that you can get on with the creative part.
+
+It uses [Vite](https://vitejs.dev/) with a [Svelte plugin](https://github.com/sveltejs/vite-plugin-svelte) to provide a lightning-fast and feature-rich development experience with [Hot Module Replacement (HMR)](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#hot), where changes to your code are reflected in the browser instantly.
diff --git a/documentation/docs/20-core-concepts/10-routing.md b/documentation/docs/20-core-concepts/10-routing.md
index 0387089c1..1646886d8 100644
--- a/documentation/docs/20-core-concepts/10-routing.md
+++ b/documentation/docs/20-core-concepts/10-routing.md
@@ -127,7 +127,7 @@ If an error occurs during `load`, SvelteKit will render a default error page. Yo
 <h1>{$page.status}: {$page.error.message}</h1>
 ```
 
-SvelteKit will 'walk up the tree' looking for the closest error boundary — if the file above didn't exist it would try `src/routes/blog/+error.svelte` and `src/routes/+error.svelte` before rendering the default error page. If _that_ fails (or if the error was thrown from the `load` function of the root `+layout`, which sits 'above' the root `+error`), SvelteKit will bail out and render a static fallback error page, which you can customise by creating a `src/error.html` file.
+SvelteKit will 'walk up the tree' looking for the closest error boundary — if the file above didn't exist it would try `src/routes/blog/+error.svelte` and then `src/routes/+error.svelte` before rendering the default error page. If _that_ fails (or if the error was thrown from the `load` function of the root `+layout`, which sits 'above' the root `+error`), SvelteKit will bail out and render a static fallback error page, which you can customise by creating a `src/error.html` file.
 
 > `+error.svelte` is _not_ used when an error occurs inside [`handle`](/docs/hooks#server-hooks-handle) or a [+server.js](#server) request handler.
 
@@ -201,7 +201,7 @@ We can create a layout that only applies to pages below `/settings` (while inher
 <slot></slot>
 ```
 
-By default, each layout inherits the next layout above it. Sometimes that isn't what you want - in this case, [advanced layouts](/docs/advanced-routing#advanced-layouts) can help you.
+By default, each layout inherits the layout above it. Sometimes that isn't what you want - in this case, [advanced layouts](/docs/advanced-routing#advanced-layouts) can help you.
 
 ### +layout.js
 
diff --git a/documentation/docs/20-core-concepts/20-load.md b/documentation/docs/20-core-concepts/20-load.md
index 0e7b5ede3..a4f8d9561 100644
--- a/documentation/docs/20-core-concepts/20-load.md
+++ b/documentation/docs/20-core-concepts/20-load.md
@@ -34,7 +34,7 @@ export function load({ params }) {
 
 Thanks to the generated `$types` module, we get full type safety.
 
-A `load` function in a `+page.js` file runs both on the server and in the browser. If your `load` function should _always_ run on the server (because it uses private environment variables, for example, or accesses a database) then you can put it in a `+page.server.js` instead.
+A `load` function in a `+page.js` file runs both on the server and in the browser. If your `load` function should _always_ run on the server (because it uses private environment variables, for example, or accesses a database) then it would go in a `+page.server.js` instead.
 
 A more realistic version of your blog post's `load` function, that only runs on the server and pulls data from a database, might look like this:
 
@@ -90,9 +90,8 @@ export async function load() {
 </script>
 
 <main>
-	<slot>
-		<!-- +page.svelte is rendered here -->
-	</slot>
+	<!-- +page.svelte is rendered in this <slot> -->
+	<slot />
 </main>
 
 <aside>
@@ -422,7 +421,7 @@ Top-level promises will be awaited, which makes it easy to return multiple promi
 
 ```js
 /// file: src/routes/+page.js
-/** @type {import('./$types').PageServerLoad} */
+/** @type {import('./$types').PageLoad} */
 export function load() {
 	return {
 		a: Promise.resolve('a'),
diff --git a/documentation/docs/30-advanced/10-advanced-routing.md b/documentation/docs/30-advanced/10-advanced-routing.md
index f703d1719..e227edfac 100644
--- a/documentation/docs/30-advanced/10-advanced-routing.md
+++ b/documentation/docs/30-advanced/10-advanced-routing.md
@@ -98,7 +98,7 @@ It's possible for multiple routes to match a given path. For example each of the
 
 ```bash
 src/routes/[...catchall]/+page.svelte
-src/routes/[[a]]/foo/+page.svelte
+src/routes/[[a=x]]/+page.svelte
 src/routes/[b]/+page.svelte
 src/routes/foo-[c]/+page.svelte
 src/routes/foo-abc/+page.svelte
@@ -116,7 +116,7 @@ SvelteKit needs to know which route is being requested. To do so, it sorts them
 ```bash
 src/routes/foo-abc/+page.svelte
 src/routes/foo-[c]/+page.svelte
-src/routes/[[a]]/foo/+page.svelte
+src/routes/[[a=x]]/+page.svelte
 src/routes/[b]/+page.svelte
 src/routes/[...catchall]/+page.svelte
 ```
diff --git a/documentation/docs/30-advanced/20-hooks.md b/documentation/docs/30-advanced/20-hooks.md
index 2f7b0b2e8..1e9d50e92 100644
--- a/documentation/docs/30-advanced/20-hooks.md
+++ b/documentation/docs/30-advanced/20-hooks.md
@@ -66,7 +66,7 @@ export async function handle({ event, resolve }) {
 }
 ```
 
-You can add call multiple `handle` functions with [the `sequence` helper function](/docs/modules#sveltejs-kit-hooks).
+You can define multiple `handle` functions and execute them with [the `sequence` helper function](/docs/modules#sveltejs-kit-hooks).
 
 `resolve` also supports a second, optional parameter that gives you more control over how the response will be rendered. That parameter is an object that can have the following fields:
 
@@ -99,7 +99,7 @@ Or your `load` function might make a request to a public URL like `https://api.y
 ```js
 /// file: src/hooks.server.js
 /** @type {import('@sveltejs/kit').HandleFetch} */
-export async function handleFetch({ request, fetch }) {
+export function handleFetch({ request, fetch }) {
 	if (request.url.startsWith('https://api.yourapp.com/')) {
 		// clone the original request, but change the URL
 		request = new Request(
@@ -124,7 +124,7 @@ If your app and your API are on sibling subdomains — `www.my-domain.com` and `
 /// file: src/hooks.server.js
 // @errors: 2345
 /** @type {import('@sveltejs/kit').HandleFetch} */
-export async function handleFetch({ event, request, fetch }) {
+export function handleFetch({ event, request, fetch }) {
 	if (request.url.startsWith('https://api.my-domain.com/')) {
 		request.headers.set('cookie', event.request.headers.get('cookie'));
 	}
@@ -160,12 +160,18 @@ declare namespace App {
 /// file: src/hooks.server.js
 // @errors: 2322
 // @filename: ambient.d.ts
-const Sentry: any;
+declare module '@sentry/node' {
+	export const init: (opts: any) => void;
+	export const captureException: (error: any, opts: any) => void;
+}
 
 // @filename: index.js
 // ---cut---
+import * as Sentry from '@sentry/node';
 import crypto from 'crypto';
 
+Sentry.init({/*...*/})
+
 /** @type {import('@sveltejs/kit').HandleServerError} */
 export function handleError({ error, event }) {
 	const errorId = crypto.randomUUID();
@@ -183,10 +189,17 @@ export function handleError({ error, event }) {
 /// file: src/hooks.client.js
 // @errors: 2322
 // @filename: ambient.d.ts
-const Sentry: any;
+declare module '@sentry/svelte' {
+	export const init: (opts: any) => void;
+	export const captureException: (error: any, opts: any) => void;
+}
 
 // @filename: index.js
 // ---cut---
+import * as Sentry from '@sentry/svelte';
+
+Sentry.init({/*...*/})
+
 /** @type {import('@sveltejs/kit').HandleClientError} */
 export function handleError({ error, event }) {
 	const errorId = crypto.randomUUID();
diff --git a/documentation/docs/30-advanced/25-errors.md b/documentation/docs/30-advanced/25-errors.md
index 331a992d3..40ac2269e 100644
--- a/documentation/docs/30-advanced/25-errors.md
+++ b/documentation/docs/30-advanced/25-errors.md
@@ -8,7 +8,7 @@ Errors are an inevitable fact of software development. SvelteKit handles errors
 
 SvelteKit distinguishes between expected and unexpected errors, both of which are represented as simple `{ message: string }` objects by default.
 
-You can add additional properties, like a `code` or a tracking `id`, as shown below.
+You can add additional properties, like a `code` or a tracking `id`, as shown in the examples below. (When using TypeScript this requires you to redefine the `Error` type as described in  [type safety](/docs/errors#type-safety)).
 
 ## Expected errors
 
@@ -83,10 +83,17 @@ Unexpected errors will go through the [`handleError`](/docs/hooks#shared-hooks-h
 /// file: src/hooks.server.js
 // @errors: 2322 1360 2571 2339
 // @filename: ambient.d.ts
-const Sentry: any;
+declare module '@sentry/node' {
+	export const init: (opts: any) => void;
+	export const captureException: (error: any, opts: any) => void;
+}
 
 // @filename: index.js
 // ---cut---
+import * as Sentry from '@sentry/node';
+
+Sentry.init({/*...*/})
+
 /** @type {import('@sveltejs/kit').HandleServerError} */
 export function handleError({ error, event }) {
 	// example integration with https://sentry.io/
@@ -140,4 +147,4 @@ declare namespace App {
 }
 ```
 
-This interface always includes a `message: string` property.
\ No newline at end of file
+This interface always includes a `message: string` property.
diff --git a/documentation/docs/60-appendix/10-migrating.md b/documentation/docs/60-appendix/10-migrating.md
index e74a7badc..759bec196 100644
--- a/documentation/docs/60-appendix/10-migrating.md
+++ b/documentation/docs/60-appendix/10-migrating.md
@@ -187,7 +187,7 @@ export async function handle({ event, resolve }) {
 
 	return resolve(event, {
 		transformPageChunk: ({ html, done }) => {
-			html += page;
+			page += html;
 			if (done) {
 				return building ? minify(page, minification_options) : page;
 			}
diff --git a/documentation/faq/70-packages.md b/documentation/faq/70-packages.md
index 6c7a1fd9c..1eebf3f4a 100644
--- a/documentation/faq/70-packages.md
+++ b/documentation/faq/70-packages.md
@@ -2,15 +2,15 @@
 title: How do I fix the error I'm getting trying to include a package?
 ---
 
-Vite's SSR support has become fairly stable since Vite 2.7. Most issues related to including a library are due to incorrect packaging.
+Most issues related to including a library are due to incorrect packaging. You can check if a library's packaging is compatible with Node.js by entering it into [the publint website](https://publint.dev/).
 
-Libraries work best with Vite when they distribute an ESM version and you may wish to suggest this to library authors. Here are a few things to keep in mind when checking if a library is packaged correctly:
+Here are a few things to keep in mind when checking if a library is packaged correctly:
 
 - `exports` takes precedence over the other entry point fields such as `main` and `module`. Adding an `exports` field may not be backwards-compatible as it prevents deep imports.
 - ESM files should end with `.mjs` unless `"type": "module"` is set in which any case CommonJS files should end with `.cjs`.
 - `main` should be defined if `exports` is not. It should be either a CommonJS or ESM file and adhere to the previous bullet. If a `module` field is defined, it should refer to an ESM file.
-- Svelte components should be distributed entirely as ESM and have a `svelte` field defining the entry point.
+- Svelte components should be distributed as uncompiled `.svelte` files with any JS in the package written as ESM only. Custom script and style languages, like TypeScript and SCSS, should be preprocessed as vanilla JS and CSS respectively. We recommend using [`svelte-package`](/docs/packaging) for packaging Svelte libraries, which will do this for you.
 
-It is encouraged to make sure the dependencies of external Svelte components provide an ESM version. However, in order to handle CommonJS dependencies [`vite-plugin-svelte` will look for any CJS dependencies of external Svelte components](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#what-is-going-on-with-vite-and-pre-bundling-dependencies) and ask Vite to pre-bundle them by automatically adding them to Vite's `optimizeDeps.include` which will use `esbuild` to convert them to ESM. A side effect of this approach is that it takes longer to load the initial page. If this becomes noticeable, try setting [experimental.prebundleSvelteLibraries: true](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#prebundlesveltelibraries) in `svelte.config.js`. Note that this option is experimental.
+Libraries work best in the browser with Vite when they distribute an ESM version, especially if they are dependencies of a Svelte component library. You may wish to suggest to library authors that they provide an ESM version. However, CommonJS (CJS) dependencies should work as well since, by default, [`vite-plugin-svelte` will ask Vite to pre-bundle them](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#what-is-going-on-with-vite-and-pre-bundling-dependencies) using `esbuild` to convert them to ESM.
 
-If you are still encountering issues we recommend checking [the list of known Vite issues most commonly affecting SvelteKit users](https://github.com/sveltejs/kit/issues/2086) and searching both [the Vite issue tracker](https://github.com/vitejs/vite/issues) and the issue tracker of the library in question. Sometimes issues can be worked around by fiddling with the [`optimizeDeps`](https://vitejs.dev/config/#dep-optimization-options) or [`ssr`](https://vitejs.dev/config/#ssr-options) config values.
+If you are still encountering issues we recommend searching both [the Vite issue tracker](https://github.com/vitejs/vite/issues) and the issue tracker of the library in question. Sometimes issues can be worked around by fiddling with the [`optimizeDeps`](https://vitejs.dev/config/#dep-optimization-options) or [`ssr`](https://vitejs.dev/config/#ssr-options) config values though we recommend this as only a short-term workaround in favor of fixing the library in question.
diff --git a/documentation/faq/80-integrations.md b/documentation/faq/80-integrations.md
index 94ee0f84e..3fb04b932 100644
--- a/documentation/faq/80-integrations.md
+++ b/documentation/faq/80-integrations.md
@@ -8,39 +8,6 @@ Make sure you've read the [documentation section on integrations](/docs/integrat
 
 Put the code to query your database in a [server route](/docs/routing#server) - don't query the database in .svelte files. You can create a `db.js` or similar that sets up a connection immediately and makes the client accessible throughout the app as a singleton. You can execute any one-time setup code in `hooks.js` and import your database helpers into any endpoint that needs them.
 
-### How do I use middleware?
-
-`adapter-node` builds a middleware that you can use with your own server for production mode. In dev, you can add middleware to Vite by using a Vite plugin. For example:
-
-```js
-// @filename: ambient.d.ts
-declare module '@sveltejs/kit/vite'; // TODO this feels unnecessary, why can't it 'see' the declarations?
-
-// @filename: index.js
-// ---cut---
-import { sveltekit } from '@sveltejs/kit/vite';
-
-/** @type {import('vite').Plugin} */
-const myPlugin = {
-	name: 'log-request-middleware',
-	configureServer(server) {
-		server.middlewares.use((req, res, next) => {
-			console.log(`Got request ${req.url}`);
-			next();
-		});
-	}
-};
-
-/** @type {import('vite').UserConfig} */
-const config = {
-	plugins: [myPlugin, sveltekit()]
-};
-
-export default config;
-```
-
-See [Vite's `configureServer` docs](https://vitejs.dev/guide/api-plugin.html#configureserver) for more details including how to control ordering.
-
 ### How do I use a client-side only library that depends on `document` or `window`?
 
 If you need access to the `document` or `window` variables or otherwise need code to run only on the client-side you can wrap it in a `browser` check:
@@ -106,6 +73,57 @@ onMount(() => {
 });
 ```
 
+### How do I use a different backend API server?
+
+You can use [`event.fetch`](/docs/load#making-fetch-requests) to request data from an external API server, but be aware that you would need to deal with [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), which will result in complications such as generally requiring requests to be preflighted resulting in higher latency. Requests to a separate subdomain may also increase latency due to an additional DNS lookup, TLS setup, etc. If you wish to use this method, you may find [`handleFetch`](/docs/hooks#server-hooks-handlefetch) helpful.
+
+Another approach is to set up a proxy to bypass CORS headaches. In production, you would rewrite a path like `/api` to the API server; for local development, use Vite's [`server.proxy`](https://vitejs.dev/config/server-options.html#server-proxy) option.
+
+How to setup rewrites in production will depend on your deployment platform. If rewrites aren't an option, you could alternatively add an [API route](https://kit.svelte.dev/docs/routing#server):
+
+```js
+/// file: src/routes/api/[...path]/+server.js
+/** @type {import('./$types').RequestHandler} */
+export function GET({ params, url }) {
+	return fetch(`https://my-api-server.com/${params.path + url.search}`);
+}
+```
+
+(Note that you may also need to proxy `POST`/`PATCH` etc requests, and forward `request.headers`, depending on your needs.)
+
+### How do I use middleware?
+
+`adapter-node` builds a middleware that you can use with your own server for production mode. In dev, you can add middleware to Vite by using a Vite plugin. For example:
+
+```js
+// @filename: ambient.d.ts
+declare module '@sveltejs/kit/vite'; // TODO this feels unnecessary, why can't it 'see' the declarations?
+
+// @filename: index.js
+// ---cut---
+import { sveltekit } from '@sveltejs/kit/vite';
+
+/** @type {import('vite').Plugin} */
+const myPlugin = {
+	name: 'log-request-middleware',
+	configureServer(server) {
+		server.middlewares.use((req, res, next) => {
+			console.log(`Got request ${req.url}`);
+			next();
+		});
+	}
+};
+
+/** @type {import('vite').UserConfig} */
+const config = {
+	plugins: [myPlugin, sveltekit()]
+};
+
+export default config;
+```
+
+See [Vite's `configureServer` docs](https://vitejs.dev/guide/api-plugin.html#configureserver) for more details including how to control ordering.
+
 ### Does it work with Yarn 2?
 
 Sort of. The Plug'n'Play feature, aka 'pnp', is broken (it deviates from the Node module resolution algorithm, and [doesn't yet work with native JavaScript modules](https://github.com/yarnpkg/berry/issues/638) which SvelteKit — along with an [increasing number of packages](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77) — uses). You can use `nodeLinker: 'node-modules'` in your [`.yarnrc.yml`](https://yarnpkg.com/configuration/yarnrc#nodeLinker) file to disable pnp, but it's probably easier to just use npm or [pnpm](https://pnpm.io/), which is similarly fast and efficient but without the compatibility headaches.
diff --git a/package.json b/package.json
index 2abe67c54..955239522 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
 		"turbo": "^1.6.3",
 		"typescript": "^4.9.4"
 	},
-	"packageManager": "pnpm@7.19.0",
+	"packageManager": "pnpm@7.22.0",
 	"engines": {
 		"pnpm": "^7.0.0"
 	},
diff --git a/packages/adapter-cloudflare-workers/CHANGELOG.md b/packages/adapter-cloudflare-workers/CHANGELOG.md
index 08157eb56..852ee63c0 100644
--- a/packages/adapter-cloudflare-workers/CHANGELOG.md
+++ b/packages/adapter-cloudflare-workers/CHANGELOG.md
@@ -1,5 +1,14 @@
 # @sveltejs/adapter-cloudflare-workers
 
+## 1.0.1
+
+### Patch Changes
+
+- [chore] update @cloudflare/kv-asset-handler ([`30e1130e`](https://github.com/sveltejs/kit/commit/30e1130ef84e56a77be5cb1136d5c53edef6e5f9))
+
+- Updated dependencies [[`fab0de4f`](https://github.com/sveltejs/kit/commit/fab0de4f06ac5b1e9b049e106889b193975c1c29), [`89b8d94b`](https://github.com/sveltejs/kit/commit/89b8d94b1b20d586e1ca525c30d07587c3f2d8f2)]:
+  - @sveltejs/kit@1.0.2
+
 ## 1.0.0
 
 ### Major Changes
diff --git a/packages/adapter-cloudflare-workers/package.json b/packages/adapter-cloudflare-workers/package.json
index d7195b467..0c30adeae 100644
--- a/packages/adapter-cloudflare-workers/package.json
+++ b/packages/adapter-cloudflare-workers/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/adapter-cloudflare-workers",
-	"version": "1.0.0",
+	"version": "1.0.1",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/adapter-node/CHANGELOG.md b/packages/adapter-node/CHANGELOG.md
index 80ca82f61..3842b7886 100644
--- a/packages/adapter-node/CHANGELOG.md
+++ b/packages/adapter-node/CHANGELOG.md
@@ -1,5 +1,18 @@
 # @sveltejs/adapter-node
 
+## 1.0.1
+
+### Patch Changes
+
+- Update dependency @rollup/plugin-json to v6 ([#8204](https://github.com/sveltejs/kit/pull/8204))
+
+  Note: plugin-json v6 fails your build for parse errors that only logged a warning with v5. We consider this a bugfix as only healthy input should result in a successful build.
+
+- chore(deps): update dependency @rollup/plugin-commonjs to v24 ([#8216](https://github.com/sveltejs/kit/pull/8216))
+
+- Updated dependencies [[`fab0de4f`](https://github.com/sveltejs/kit/commit/fab0de4f06ac5b1e9b049e106889b193975c1c29), [`89b8d94b`](https://github.com/sveltejs/kit/commit/89b8d94b1b20d586e1ca525c30d07587c3f2d8f2)]:
+  - @sveltejs/kit@1.0.2
+
 ## 1.0.0
 
 ### Major Changes
diff --git a/packages/adapter-node/package.json b/packages/adapter-node/package.json
index dbbe91e4f..969a9b2ab 100644
--- a/packages/adapter-node/package.json
+++ b/packages/adapter-node/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/adapter-node",
-	"version": "1.0.0",
+	"version": "1.0.1",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/adapter-static/package.json b/packages/adapter-static/package.json
index 47949a5e3..20f917c54 100644
--- a/packages/adapter-static/package.json
+++ b/packages/adapter-static/package.json
@@ -31,7 +31,7 @@
 		"svelte": "^3.55.0",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"peerDependencies": {
 		"@sveltejs/kit": "^1.0.0"
diff --git a/packages/create-svelte/CHANGELOG.md b/packages/create-svelte/CHANGELOG.md
index 3f74ac1d2..6b4d4a3a7 100644
--- a/packages/create-svelte/CHANGELOG.md
+++ b/packages/create-svelte/CHANGELOG.md
@@ -1,5 +1,11 @@
 # create-svelte
 
+## 2.0.2
+
+### Patch Changes
+
+- [fix] address flakiness in playwright test ([#8162](https://github.com/sveltejs/kit/pull/8162))
+
 ## 2.0.1
 
 ### Patch Changes
diff --git a/packages/create-svelte/package.json b/packages/create-svelte/package.json
index 28355f820..f3ba2889d 100644
--- a/packages/create-svelte/package.json
+++ b/packages/create-svelte/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "create-svelte",
-	"version": "2.0.1",
+	"version": "2.0.2",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/create-svelte/shared/vite.config.js b/packages/create-svelte/shared/vite.config.ts
similarity index 67%
rename from packages/create-svelte/shared/vite.config.js
rename to packages/create-svelte/shared/vite.config.ts
index 874705053..60ef89c74 100644
--- a/packages/create-svelte/shared/vite.config.js
+++ b/packages/create-svelte/shared/vite.config.ts
@@ -1,7 +1,8 @@
 import { sveltekit } from '@sveltejs/kit/vite';
+import type { UserConfig } from 'vite';
 
 /** @type {import('vite').UserConfig} */
-const config = {
+const config: UserConfig = {
 	plugins: [sveltekit()]
 };
 
diff --git a/packages/kit/CHANGELOG.md b/packages/kit/CHANGELOG.md
index e1a361713..64041cc69 100644
--- a/packages/kit/CHANGELOG.md
+++ b/packages/kit/CHANGELOG.md
@@ -1,5 +1,19 @@
 # @sveltejs/kit
 
+## 1.0.3
+
+### Patch Changes
+
+- Include submitter's value when progressively enhancing `<form method="get">` ([#8273](https://github.com/sveltejs/kit/pull/8273))
+
+## 1.0.2
+
+### Patch Changes
+
+- Fix filterSerializedResponseHeaders error message ([#8348](https://github.com/sveltejs/kit/pull/8348))
+
+- Fix form action redirect status code ([#8210](https://github.com/sveltejs/kit/pull/8210))
+
 ## 1.0.1
 
 ### Patch Changes
diff --git a/packages/kit/package.json b/packages/kit/package.json
index 5bce20566..0dc30e9e8 100644
--- a/packages/kit/package.json
+++ b/packages/kit/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/kit",
-	"version": "1.0.1",
+	"version": "1.0.3",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
@@ -38,7 +38,7 @@
 		"svelte-preprocess": "^5.0.0",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"peerDependencies": {
 		"svelte": "^3.54.0",
diff --git a/packages/kit/src/core/prerender/prerender.js b/packages/kit/src/core/prerender/prerender.js
index 65ece5d73..aa3e732c6 100644
--- a/packages/kit/src/core/prerender/prerender.js
+++ b/packages/kit/src/core/prerender/prerender.js
@@ -1,8 +1,9 @@
 import { readFileSync, writeFileSync } from 'fs';
 import { dirname, join } from 'path';
 import { pathToFileURL, URL } from 'url';
-import { mkdirp, posixify, walk } from '../../utils/filesystem.js';
 import { installPolyfills } from '../../exports/node/polyfills.js';
+import { mkdirp, posixify, walk } from '../../utils/filesystem.js';
+import { should_polyfill } from '../../utils/platform.js';
 import { is_root_relative, resolve } from '../../utils/url.js';
 import { queue } from './queue.js';
 import { crawl } from './crawl.js';
@@ -89,7 +90,9 @@ export async function prerender() {
 		verbose: verbose === 'true'
 	});
 
-	installPolyfills();
+	if (should_polyfill) {
+		installPolyfills();
+	}
 
 	const server_root = join(config.outDir, 'output');
 
diff --git a/packages/kit/src/exports/node/polyfills.js b/packages/kit/src/exports/node/polyfills.js
index ba0e49ef8..88805160b 100644
--- a/packages/kit/src/exports/node/polyfills.js
+++ b/packages/kit/src/exports/node/polyfills.js
@@ -16,6 +16,7 @@ const globals = {
 };
 
 // exported for dev/preview and node environments
+// TODO: remove this once we only support Node 18.11+ (the version multipart/form-data was added)
 export function installPolyfills() {
 	for (const name in globals) {
 		Object.defineProperty(globalThis, name, {
diff --git a/packages/kit/src/exports/vite/dev/index.js b/packages/kit/src/exports/vite/dev/index.js
index 545af8d1f..571db3d22 100644
--- a/packages/kit/src/exports/vite/dev/index.js
+++ b/packages/kit/src/exports/vite/dev/index.js
@@ -8,6 +8,7 @@ import { getRequest, setResponse } from '../../../exports/node/index.js';
 import { installPolyfills } from '../../../exports/node/polyfills.js';
 import { coalesce_to_error } from '../../../utils/error.js';
 import { posixify, resolve_entry, to_fs } from '../../../utils/filesystem.js';
+import { should_polyfill } from '../../../utils/platform.js';
 import { load_error_page, load_template } from '../../../core/config/index.js';
 import { SVELTE_KIT_ASSETS } from '../../../constants.js';
 import * as sync from '../../../core/sync/sync.js';
@@ -24,7 +25,9 @@ const cwd = process.cwd();
  * @return {Promise<Promise<() => void>>}
  */
 export async function dev(vite, vite_config, svelte_config) {
-	installPolyfills();
+	if (should_polyfill) {
+		installPolyfills();
+	}
 
 	sync.init(svelte_config, vite_config.mode);
 
diff --git a/packages/kit/src/exports/vite/preview/index.js b/packages/kit/src/exports/vite/preview/index.js
index 45ac7344b..b62db099c 100644
--- a/packages/kit/src/exports/vite/preview/index.js
+++ b/packages/kit/src/exports/vite/preview/index.js
@@ -2,10 +2,11 @@ import fs from 'fs';
 import { join } from 'path';
 import sirv from 'sirv';
 import { pathToFileURL } from 'url';
+import { loadEnv, normalizePath } from 'vite';
 import { getRequest, setResponse } from '../../../exports/node/index.js';
 import { installPolyfills } from '../../../exports/node/polyfills.js';
 import { SVELTE_KIT_ASSETS } from '../../../constants.js';
-import { loadEnv, normalizePath } from 'vite';
+import { should_polyfill } from '../../../utils/platform.js';
 import { not_found } from '../utils.js';
 
 /** @typedef {import('http').IncomingMessage} Req */
@@ -21,7 +22,9 @@ import { not_found } from '../utils.js';
  * @param {import('types').ValidatedConfig} svelte_config
  */
 export async function preview(vite, vite_config, svelte_config) {
-	installPolyfills();
+	if (should_polyfill) {
+		installPolyfills();
+	}
 
 	const { paths } = svelte_config.kit;
 	const base = paths.base;
diff --git a/packages/kit/src/runtime/client/client.js b/packages/kit/src/runtime/client/client.js
index ea1a1a6bf..c85004811 100644
--- a/packages/kit/src/runtime/client/client.js
+++ b/packages/kit/src/runtime/client/client.js
@@ -1461,21 +1461,28 @@ export function create_client({ target, base }) {
 				if (method !== 'get') return;
 
 				const url = new URL(
-					(event.submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action
+					(submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action
 				);
 
 				if (is_external_url(url, base)) return;
 
-				const { noscroll, reload } = get_router_options(
-					/** @type {HTMLFormElement} */ (event.target)
-				);
+				const event_form = /** @type {HTMLFormElement} */ (event.target);
+
+				const { noscroll, reload } = get_router_options(event_form);
 				if (reload) return;
 
 				event.preventDefault();
 				event.stopPropagation();
 
+				const data = new FormData(event_form);
+
+				const submitter_name = submitter?.getAttribute('name');
+				if (submitter_name) {
+					data.append(submitter_name, submitter?.getAttribute('value') ?? '');
+				}
+
 				// @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that
-				url.search = new URLSearchParams(new FormData(event.target)).toString();
+				url.search = new URLSearchParams(data).toString();
 
 				navigate({
 					url,
diff --git a/packages/kit/src/runtime/server/page/load_data.js b/packages/kit/src/runtime/server/page/load_data.js
index 99735c2e4..f5f20c44f 100644
--- a/packages/kit/src/runtime/server/page/load_data.js
+++ b/packages/kit/src/runtime/server/page/load_data.js
@@ -211,7 +211,7 @@ export async function load_data({
 						const included = resolve_opts.filterSerializedResponseHeaders(lower, value);
 						if (!included) {
 							throw new Error(
-								`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route})`
+								`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route.id})`
 							);
 						}
 					}
diff --git a/packages/kit/src/utils/platform.js b/packages/kit/src/utils/platform.js
new file mode 100644
index 000000000..e32dd5f5a
--- /dev/null
+++ b/packages/kit/src/utils/platform.js
@@ -0,0 +1,1 @@
+export const should_polyfill = typeof Deno === 'undefined' && typeof Bun === 'undefined';
diff --git a/packages/kit/types/internal.d.ts b/packages/kit/types/internal.d.ts
index f45b76390..4d558c88e 100644
--- a/packages/kit/types/internal.d.ts
+++ b/packages/kit/types/internal.d.ts
@@ -389,4 +389,6 @@ declare global {
 	const __SVELTEKIT_BROWSER__: boolean;
 	const __SVELTEKIT_DEV__: boolean;
 	const __SVELTEKIT_EMBEDDED__: boolean;
+	var Bun: object;
+	var Deno: object;
 }
diff --git a/packages/package/CHANGELOG.md b/packages/package/CHANGELOG.md
index 20101aaed..0a941c823 100644
--- a/packages/package/CHANGELOG.md
+++ b/packages/package/CHANGELOG.md
@@ -1,5 +1,11 @@
 # @sveltejs/package
 
+## 1.0.2
+
+### Patch Changes
+
+- [chore] update svelte2tsx ([`50a3c5a6`](https://github.com/sveltejs/kit/commit/50a3c5a6d1282c64422e80fe19b352c14e41c853))
+
 ## 1.0.1
 
 ### Patch Changes
diff --git a/packages/package/package.json b/packages/package/package.json
index b5085cbcc..5d3ef3783 100644
--- a/packages/package/package.json
+++ b/packages/package/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/package",
-	"version": "1.0.1",
+	"version": "1.0.2",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ba5b6ff7e..ec26cfaae 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -147,7 +147,7 @@ importers:
       svelte: ^3.55.0
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../kit
       '@types/node': 16.18.6
@@ -155,17 +155,17 @@ importers:
       svelte: 3.55.0
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0_@types+node@16.18.6
+      vite: 4.0.4_@types+node@16.18.6
 
   packages/adapter-static/test/apps/prerendered:
     specifiers:
       '@sveltejs/kit': workspace:^
       svelte: ^3.55.0
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../../kit
       svelte: 3.55.0
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/adapter-static/test/apps/spa:
     specifiers:
@@ -173,13 +173,13 @@ importers:
       '@sveltejs/kit': workspace:^
       sirv-cli: ^2.0.2
       svelte: ^3.55.0
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/adapter-node': link:../../../../adapter-node
       '@sveltejs/kit': link:../../../../kit
       sirv-cli: 2.0.2
       svelte: 3.55.0
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/adapter-vercel:
     specifiers:
@@ -247,7 +247,7 @@ importers:
       '@sveltejs/kit': link:../../../kit
       svelte: 3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/create-svelte/templates/skeleton:
     specifiers:
@@ -283,9 +283,9 @@ importers:
       typescript: ^4.9.4
       undici: 5.14.0
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     dependencies:
-      '@sveltejs/vite-plugin-svelte': 2.0.0_svelte@3.55.0+vite@4.0.0
+      '@sveltejs/vite-plugin-svelte': 2.0.0_svelte@3.55.0+vite@4.0.4
       '@types/cookie': 0.5.1
       cookie: 0.5.0
       devalue: 4.2.0
@@ -312,7 +312,7 @@ importers:
       svelte-preprocess: 5.0.0_niwyv7xychq2ag6arq5eqxbomm
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0_@types+node@16.18.6
+      vite: 4.0.4_@types+node@16.18.6
 
   packages/kit/test/apps/amp:
     specifiers:
@@ -323,7 +323,7 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/amp': link:../../../../amp
       '@sveltejs/kit': link:../../..
@@ -332,7 +332,7 @@ importers:
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/apps/basics:
     specifiers:
@@ -342,7 +342,7 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       cross-env: 7.0.3
@@ -350,7 +350,7 @@ importers:
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/apps/dev-only:
     specifiers:
@@ -360,7 +360,7 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       cross-env: 7.0.3
@@ -368,7 +368,7 @@ importers:
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/apps/options:
     specifiers:
@@ -377,14 +377,14 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       cross-env: 7.0.3
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/apps/options-2:
     specifiers:
@@ -394,7 +394,7 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/adapter-node': link:../../../../adapter-node
       '@sveltejs/kit': link:../../..
@@ -402,7 +402,7 @@ importers:
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/apps/writes:
     specifiers:
@@ -412,7 +412,7 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       cross-env: 7.0.3
@@ -420,7 +420,7 @@ importers:
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors:
     specifiers:
@@ -435,14 +435,14 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.7.1
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/adapter-auto': link:../../../../../adapter-auto
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/prerenderable-not-prerendered:
     specifiers:
@@ -451,14 +451,14 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/adapter-auto': link:../../../../../adapter-auto
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/private-dynamic-env:
     specifiers:
@@ -466,13 +466,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import:
     specifiers:
@@ -480,13 +480,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/private-static-env:
     specifiers:
@@ -495,14 +495,14 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       cross-env: 7.0.3
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/private-static-env-dynamic-import:
     specifiers:
@@ -510,13 +510,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/server-only-folder:
     specifiers:
@@ -524,13 +524,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/server-only-folder-dynamic-import:
     specifiers:
@@ -538,13 +538,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/server-only-module:
     specifiers:
@@ -552,13 +552,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/build-errors/apps/server-only-module-dynamic-import:
     specifiers:
@@ -566,13 +566,13 @@ importers:
       svelte: ^3.55.0
       svelte-check: ^2.9.2
       typescript: ^4.9.4
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/prerendering/basics:
     specifiers:
@@ -581,14 +581,14 @@ importers:
       svelte-check: ^2.9.2
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/prerendering/options:
     specifiers:
@@ -597,14 +597,14 @@ importers:
       svelte-check: ^2.9.2
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/prerendering/paths-base:
     specifiers:
@@ -613,14 +613,14 @@ importers:
       svelte-check: ^2.9.2
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/kit/test/prerendering/ssr-false:
     specifiers:
@@ -629,14 +629,14 @@ importers:
       svelte-check: ^2.9.2
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
+      vite: ^4.0.4
     devDependencies:
       '@sveltejs/kit': link:../../..
       svelte: 3.55.0
       svelte-check: 2.9.2_svelte@3.55.0
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0
+      vite: 4.0.4
 
   packages/migrate:
     specifiers:
@@ -704,8 +704,8 @@ importers:
       topojson-client: ^3.1.0
       typescript: ^4.9.4
       uvu: ^0.5.6
-      vite: ^4.0.0
-      vite-imagetools: ^4.0.11
+      vite: ^4.0.4
+      vite-imagetools: ^4.0.13
     dependencies:
       d3-geo: 3.0.1
       d3-geo-projection: 4.0.0
@@ -728,8 +728,8 @@ importers:
       tiny-glob: 0.2.9
       typescript: 4.9.4
       uvu: 0.5.6
-      vite: 4.0.0_@types+node@16.18.6
-      vite-imagetools: 4.0.11
+      vite: 4.0.4_@types+node@16.18.6
+      vite-imagetools: 4.0.13
 
 packages:
 
@@ -1331,7 +1331,7 @@ packages:
     resolution: {integrity: sha512-zetnU9jGOu+DYcwqpgK9uSUv3qrGrL7JagMN7M8B4bQRoBq1lAPnCvBXtlfQckvkQLtH453JJTIX6ULqL1xtpA==}
     dev: true
 
-  /@sveltejs/vite-plugin-svelte/2.0.0_svelte@3.55.0+vite@4.0.0:
+  /@sveltejs/vite-plugin-svelte/2.0.0_svelte@3.55.0+vite@4.0.4:
     resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==}
     engines: {node: ^14.18.0 || >= 16}
     peerDependencies:
@@ -1344,8 +1344,8 @@ packages:
       magic-string: 0.27.0
       svelte: 3.55.0
       svelte-hmr: 0.15.1_svelte@3.55.0
-      vite: 4.0.0_@types+node@16.18.6
-      vitefu: 0.2.3_vite@4.0.0
+      vite: 4.0.4_@types+node@16.18.6
+      vitefu: 0.2.3_vite@4.0.4
     transitivePeerDependencies:
       - supports-color
     dev: false
@@ -2618,7 +2618,7 @@ packages:
     resolution: {integrity: sha512-YbZhedg/zja34yV6iRDhfo4cmAYSwxaErkuzc/RpMMAELgszpDKf3MLH6VlsR+QkenPUEGkGAVpJAM2GbUls9Q==}
     engines: {node: '>=12.0.0'}
     dependencies:
-      sharp: 0.31.2
+      sharp: 0.31.3
     dev: true
 
   /import-fresh/3.3.0:
@@ -3176,8 +3176,8 @@ packages:
       tslib: 2.4.1
     dev: false
 
-  /node-abi/3.28.0:
-    resolution: {integrity: sha512-fRlDb4I0eLcQeUvGq7IY3xHrSb0c9ummdvDSYWfT9+LKP+3jCKw/tKoqaM7r1BAoiAC6GtwyjaGnOz6B3OtF+A==}
+  /node-abi/3.30.0:
+    resolution: {integrity: sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw==}
     engines: {node: '>=10'}
     dependencies:
       semver: 7.3.8
@@ -3482,8 +3482,8 @@ packages:
       trouter: 3.2.0
     dev: true
 
-  /postcss/8.4.19:
-    resolution: {integrity: sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==}
+  /postcss/8.4.20:
+    resolution: {integrity: sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==}
     engines: {node: ^10 || ^12 || >=14}
     dependencies:
       nanoid: 3.3.4
@@ -3501,7 +3501,7 @@ packages:
       minimist: 1.2.7
       mkdirp-classic: 0.5.3
       napi-build-utils: 1.0.2
-      node-abi: 3.28.0
+      node-abi: 3.30.0
       pump: 3.0.0
       rc: 1.2.8
       simple-get: 4.0.1
@@ -3821,8 +3821,8 @@ packages:
     resolution: {integrity: sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==}
     dev: false
 
-  /sharp/0.31.2:
-    resolution: {integrity: sha512-DUdNVEXgS5A97cTagSLIIp8dUZ/lZtk78iNVZgHdHbx1qnQR7JAHY0BnXnwwH39Iw+VKhO08CTYhIg0p98vQ5Q==}
+  /sharp/0.31.3:
+    resolution: {integrity: sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==}
     engines: {node: '>=14.15.0'}
     requiresBuild: true
     dependencies:
@@ -4588,8 +4588,8 @@ packages:
       spdx-expression-parse: 3.0.1
     dev: true
 
-  /vite-imagetools/4.0.11:
-    resolution: {integrity: sha512-S6+vzsd/6kSBdPIdjJFGeZ4+UV/aIK09V7oLb/Z9soV3jNwKh60WBi6jF+RnKtY7F9FMU3W6xPbln+VPHI0icA==}
+  /vite-imagetools/4.0.13:
+    resolution: {integrity: sha512-DeMAhDwvWATzBa5Qu9Fv6rtOuHZFONrv5Z5a95jd/oBDDCdyTKYVqxIurS5ox9A/sH8bhVF7r++Yww0DKpjKFQ==}
     engines: {node: '>=12.0.0'}
     dependencies:
       '@rollup/pluginutils': 5.0.2
@@ -4598,8 +4598,8 @@ packages:
       - rollup
     dev: true
 
-  /vite/4.0.0:
-    resolution: {integrity: sha512-ynad+4kYs8Jcnn8J7SacS9vAbk7eMy0xWg6E7bAhS1s79TK+D7tVFGXVZ55S7RNLRROU1rxoKlvZ/qjaB41DGA==}
+  /vite/4.0.4:
+    resolution: {integrity: sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==}
     engines: {node: ^14.18.0 || >=16.0.0}
     hasBin: true
     peerDependencies:
@@ -4624,15 +4624,15 @@ packages:
         optional: true
     dependencies:
       esbuild: 0.16.3
-      postcss: 8.4.19
+      postcss: 8.4.20
       resolve: 1.22.1
       rollup: 3.7.0
     optionalDependencies:
       fsevents: 2.3.2
     dev: true
 
-  /vite/4.0.0_@types+node@16.18.6:
-    resolution: {integrity: sha512-ynad+4kYs8Jcnn8J7SacS9vAbk7eMy0xWg6E7bAhS1s79TK+D7tVFGXVZ55S7RNLRROU1rxoKlvZ/qjaB41DGA==}
+  /vite/4.0.4_@types+node@16.18.6:
+    resolution: {integrity: sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==}
     engines: {node: ^14.18.0 || >=16.0.0}
     hasBin: true
     peerDependencies:
@@ -4658,13 +4658,13 @@ packages:
     dependencies:
       '@types/node': 16.18.6
       esbuild: 0.16.3
-      postcss: 8.4.19
+      postcss: 8.4.20
       resolve: 1.22.1
       rollup: 3.7.0
     optionalDependencies:
       fsevents: 2.3.2
 
-  /vitefu/0.2.3_vite@4.0.0:
+  /vitefu/0.2.3_vite@4.0.4:
     resolution: {integrity: sha512-75l7TTuU8isAhz1QFtNKjDkqjxvndfMC1AfIMjJ0ZQ59ZD0Ow9QOIsJJX16Wv9PS8f+zMzp6fHy5cCbKG/yVUQ==}
     peerDependencies:
       vite: ^3.0.0 || ^4.0.0
@@ -4672,7 +4672,7 @@ packages:
       vite:
         optional: true
     dependencies:
-      vite: 4.0.0_@types+node@16.18.6
+      vite: 4.0.4_@types+node@16.18.6
     dev: false
 
   /vscode-oniguruma/1.6.2:
diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json
index 3a04d997e..a9ccf95ed 100644
--- a/sites/kit.svelte.dev/package.json
+++ b/sites/kit.svelte.dev/package.json
@@ -27,8 +27,8 @@
 		"tiny-glob": "^0.2.9",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0",
-		"vite-imagetools": "^4.0.11"
+		"vite": "^4.0.4",
+		"vite-imagetools": "^4.0.13"
 	},
 	"type": "module",
 	"dependencies": {
diff --git a/sites/kit.svelte.dev/src/lib/Image.svelte b/sites/kit.svelte.dev/src/lib/Image.svelte
index cb921e759..0c01919cd 100644
--- a/sites/kit.svelte.dev/src/lib/Image.svelte
+++ b/sites/kit.svelte.dev/src/lib/Image.svelte
@@ -1,5 +1,5 @@
 <script>
-	/* @type {string | import('vite-imagetools').Picture} */
+	/** @type {string | import('vite-imagetools').Picture} */
 	export let src;
 
 	/** @type {string} */
diff --git a/sites/kit.svelte.dev/vite.config.js b/sites/kit.svelte.dev/vite.config.js
index d0088f261..174e60bd8 100644
--- a/sites/kit.svelte.dev/vite.config.js
+++ b/sites/kit.svelte.dev/vite.config.js
@@ -16,7 +16,7 @@ const config = {
 				const extension = path.extname(url.pathname);
 				if (supportedExtensions.includes(extension)) {
 					return new URLSearchParams({
-						format: 'avif;webp;' + extension,
+						format: 'avif;webp;' + extension.slice(1),
 						picture: true
 					});
 				}


Test patch:
diff --git a/packages/adapter-static/test/apps/prerendered/package.json b/packages/adapter-static/test/apps/prerendered/package.json
index 2948ecd1b..7c5843545 100644
--- a/packages/adapter-static/test/apps/prerendered/package.json
+++ b/packages/adapter-static/test/apps/prerendered/package.json
@@ -10,7 +10,7 @@
 	"devDependencies": {
 		"@sveltejs/kit": "workspace:^",
 		"svelte": "^3.55.0",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/adapter-static/test/apps/spa/package.json b/packages/adapter-static/test/apps/spa/package.json
index f29595d6b..0df014e58 100644
--- a/packages/adapter-static/test/apps/spa/package.json
+++ b/packages/adapter-static/test/apps/spa/package.json
@@ -12,7 +12,7 @@
 		"@sveltejs/kit": "workspace:^",
 		"sirv-cli": "^2.0.2",
 		"svelte": "^3.55.0",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/create-svelte/shared/+vitest/vite.config.js b/packages/create-svelte/shared/+vitest/vite.config.ts
similarity index 74%
rename from packages/create-svelte/shared/+vitest/vite.config.js
rename to packages/create-svelte/shared/+vitest/vite.config.ts
index 652979fb4..4942cb347 100644
--- a/packages/create-svelte/shared/+vitest/vite.config.js
+++ b/packages/create-svelte/shared/+vitest/vite.config.ts
@@ -1,7 +1,8 @@
 import { sveltekit } from '@sveltejs/kit/vite';
+import type { UserConfig } from 'vite';
 
 /** @type {import('vite').UserConfig} */
-const config = {
+const config: UserConfig = {
 	plugins: [sveltekit()],
 	test: {
 		include: ['src/**/*.{test,spec}.{js,ts}']
diff --git a/packages/kit/test/apps/amp/package.json b/packages/kit/test/apps/amp/package.json
index f2fd96526..62c624171 100644
--- a/packages/kit/test/apps/amp/package.json
+++ b/packages/kit/test/apps/amp/package.json
@@ -19,7 +19,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/apps/basics/package.json b/packages/kit/test/apps/basics/package.json
index fcb31a869..a3a9ed08a 100644
--- a/packages/kit/test/apps/basics/package.json
+++ b/packages/kit/test/apps/basics/package.json
@@ -18,7 +18,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/apps/basics/src/routes/routing/form-get/+page.svelte b/packages/kit/test/apps/basics/src/routes/routing/form-get/+page.svelte
index f81be9901..32d898350 100644
--- a/packages/kit/test/apps/basics/src/routes/routing/form-get/+page.svelte
+++ b/packages/kit/test/apps/basics/src/routes/routing/form-get/+page.svelte
@@ -11,8 +11,9 @@
 
 <h1>{$page.url.searchParams.get('q') ?? '...'}</h1>
 <h2>{type}</h2>
+<h3>{$page.url.searchParams.get('foo') ?? '...'}</h3>
 
 <form>
 	<input name="q" />
-	<button>submit</button>
+	<button type="submit" name="foo" value="bar">Submit</button>
 </form>
diff --git a/packages/kit/test/apps/basics/test/client.test.js b/packages/kit/test/apps/basics/test/client.test.js
index 6a91def2d..82dc87df0 100644
--- a/packages/kit/test/apps/basics/test/client.test.js
+++ b/packages/kit/test/apps/basics/test/client.test.js
@@ -844,6 +844,7 @@ test.describe('Routing', () => {
 		await page.goto('/routing/form-get');
 		expect(await page.textContent('h1')).toBe('...');
 		expect(await page.textContent('h2')).toBe('enter');
+		expect(await page.textContent('h3')).toBe('...');
 
 		const requests = [];
 		page.on('request', (request) => requests.push(request.url()));
@@ -854,6 +855,7 @@ test.describe('Routing', () => {
 		expect(requests).toEqual([]);
 		expect(await page.textContent('h1')).toBe('updated');
 		expect(await page.textContent('h2')).toBe('form');
+		expect(await page.textContent('h3')).toBe('bar');
 	});
 });
 
diff --git a/packages/kit/test/apps/dev-only/package.json b/packages/kit/test/apps/dev-only/package.json
index 0dceef48e..17201325b 100644
--- a/packages/kit/test/apps/dev-only/package.json
+++ b/packages/kit/test/apps/dev-only/package.json
@@ -16,7 +16,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/apps/options-2/package.json b/packages/kit/test/apps/options-2/package.json
index 0665d55c8..94ff1c399 100644
--- a/packages/kit/test/apps/options-2/package.json
+++ b/packages/kit/test/apps/options-2/package.json
@@ -18,7 +18,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/apps/options/package.json b/packages/kit/test/apps/options/package.json
index 09f130c33..6f46501d6 100644
--- a/packages/kit/test/apps/options/package.json
+++ b/packages/kit/test/apps/options/package.json
@@ -17,7 +17,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/apps/writes/package.json b/packages/kit/test/apps/writes/package.json
index 8101b686c..69f7119e1 100644
--- a/packages/kit/test/apps/writes/package.json
+++ b/packages/kit/test/apps/writes/package.json
@@ -18,7 +18,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/prerenderable-incorrect-fragment/package.json b/packages/kit/test/build-errors/apps/prerenderable-incorrect-fragment/package.json
index a88e5cca1..75d94af4a 100644
--- a/packages/kit/test/build-errors/apps/prerenderable-incorrect-fragment/package.json
+++ b/packages/kit/test/build-errors/apps/prerenderable-incorrect-fragment/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.7.1",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/prerenderable-not-prerendered/package.json b/packages/kit/test/build-errors/apps/prerenderable-not-prerendered/package.json
index 53bd4ede4..d532d6cc4 100644
--- a/packages/kit/test/build-errors/apps/prerenderable-not-prerendered/package.json
+++ b/packages/kit/test/build-errors/apps/prerenderable-not-prerendered/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import/package.json b/packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import/package.json
index 406510172..60ea0bd0e 100644
--- a/packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import/package.json
+++ b/packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/private-dynamic-env/package.json b/packages/kit/test/build-errors/apps/private-dynamic-env/package.json
index 46c8569b5..32749ab37 100644
--- a/packages/kit/test/build-errors/apps/private-dynamic-env/package.json
+++ b/packages/kit/test/build-errors/apps/private-dynamic-env/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/private-static-env-dynamic-import/package.json b/packages/kit/test/build-errors/apps/private-static-env-dynamic-import/package.json
index cabc02028..748f99f82 100644
--- a/packages/kit/test/build-errors/apps/private-static-env-dynamic-import/package.json
+++ b/packages/kit/test/build-errors/apps/private-static-env-dynamic-import/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/private-static-env/package.json b/packages/kit/test/build-errors/apps/private-static-env/package.json
index 793489980..7f2a65275 100644
--- a/packages/kit/test/build-errors/apps/private-static-env/package.json
+++ b/packages/kit/test/build-errors/apps/private-static-env/package.json
@@ -15,7 +15,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/server-only-folder-dynamic-import/package.json b/packages/kit/test/build-errors/apps/server-only-folder-dynamic-import/package.json
index 8e10e3d9c..c52f86587 100644
--- a/packages/kit/test/build-errors/apps/server-only-folder-dynamic-import/package.json
+++ b/packages/kit/test/build-errors/apps/server-only-folder-dynamic-import/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/server-only-folder/package.json b/packages/kit/test/build-errors/apps/server-only-folder/package.json
index 63ce06eb2..b53e6a11f 100644
--- a/packages/kit/test/build-errors/apps/server-only-folder/package.json
+++ b/packages/kit/test/build-errors/apps/server-only-folder/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/server-only-module-dynamic-import/package.json b/packages/kit/test/build-errors/apps/server-only-module-dynamic-import/package.json
index 6a0789716..83beb5209 100644
--- a/packages/kit/test/build-errors/apps/server-only-module-dynamic-import/package.json
+++ b/packages/kit/test/build-errors/apps/server-only-module-dynamic-import/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/build-errors/apps/server-only-module/package.json b/packages/kit/test/build-errors/apps/server-only-module/package.json
index 33cf9eb04..f48ee067f 100644
--- a/packages/kit/test/build-errors/apps/server-only-module/package.json
+++ b/packages/kit/test/build-errors/apps/server-only-module/package.json
@@ -14,7 +14,7 @@
 		"svelte": "^3.55.0",
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/prerendering/basics/package.json b/packages/kit/test/prerendering/basics/package.json
index 86562fd79..51d48dfa7 100644
--- a/packages/kit/test/prerendering/basics/package.json
+++ b/packages/kit/test/prerendering/basics/package.json
@@ -15,7 +15,7 @@
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/prerendering/options/package.json b/packages/kit/test/prerendering/options/package.json
index 849b72cd3..bd53a85b1 100644
--- a/packages/kit/test/prerendering/options/package.json
+++ b/packages/kit/test/prerendering/options/package.json
@@ -15,7 +15,7 @@
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/prerendering/paths-base/package.json b/packages/kit/test/prerendering/paths-base/package.json
index b44f73d5c..c33592538 100644
--- a/packages/kit/test/prerendering/paths-base/package.json
+++ b/packages/kit/test/prerendering/paths-base/package.json
@@ -15,7 +15,7 @@
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }
diff --git a/packages/kit/test/prerendering/ssr-false/package.json b/packages/kit/test/prerendering/ssr-false/package.json
index 7887a34b6..52fb1d80d 100644
--- a/packages/kit/test/prerendering/ssr-false/package.json
+++ b/packages/kit/test/prerendering/ssr-false/package.json
@@ -15,7 +15,7 @@
 		"svelte-check": "^2.9.2",
 		"typescript": "^4.9.4",
 		"uvu": "^0.5.6",
-		"vite": "^4.0.0"
+		"vite": "^4.0.4"
 	},
 	"type": "module"
 }