Docs/init: SvelteKit setup references svelte.config.mjs, but Kit 3 config lives in vite.config.ts
Description
The SvelteKit on AWS setup docs and the sst init flow instruct users to add the svelte-kit-sst adapter to a svelte.config.mjs file:
It'll also ask you to update your svelte.config.mjs with something like this.
- import adapter from '@sveltejs/adapter-auto'; + import adapter from "svelte-kit-sst";
Under SvelteKit 3 (and the current sv create scaffolding), there is no svelte.config.* file at all — SvelteKit configuration now lives in the sveltekit() Vite plugin inside vite.config.ts. As a result:
sst init's "patchsvelte.config" step has no file to modify.- Following the docs verbatim leaves users with nowhere to put the adapter, and the adapter has to be wired into
vite.config.tsmanually.
Reference
SvelteKit 3 migration guide — svelte.config.js is no longer supported: https://next.svelte.dev/docs/kit/migrating-to-sveltekit-3
Instead of declaring project configuration in
svelte.config.js, it must now be passed to thesveltekitVite plugin invite.config.js. Options that previously lived underconfig.kit.*are now top-level plugin options, alongside things likecompilerOptions.
Example of the new location:
// vite.config.ts
import { defineConfig } from 'vite';
import { sveltekit } from '@sveltejs/kit/vite';
import adapter from 'svelte-kit-sst';
export default defineConfig({
plugins: [
sveltekit({
adapter: adapter()
})
]
});Related
This is the docs/init counterpart to the adapter runtime incompatibility reported in #6993 (the generated Lambda handler imports the removed @sveltejs/kit/node/polyfills export). Both stem from svelte-kit-sst / the SST Svelte docs predating SvelteKit 3.
Expected
Update the SvelteKit setup docs and the sst init flow to reflect that adapter configuration now lives in the sveltekit() plugin in vite.config.ts, rather than svelte.config.mjs — ideally once svelte-kit-sst itself supports SvelteKit 3.
Environment
| Package | Version |
|---|---|
| sst | 4.17.1 |
| svelte-kit-sst | 2.43.5 |
| @sveltejs/kit | 3.0.0-next.25 |
| @sveltejs/vite-plugin-svelte | 7.3.0 |
| svelte | 5.57.0 |
| vite | 8.2.2 |
Source: anomalyco/sst