When you build your app, adapter-auto detects the environment by checking for specific environment variables and installs the appropriate adapter automatically:
1
Environment detection
Checks for platform-specific environment variables (e.g., VERCEL, CF_PAGES, NETLIFY)
2
Adapter installation
Automatically installs the detected adapter if not already present
3
Build execution
Runs the selected adapter to generate platform-specific output
Good for: Quick starts, prototyping, and projects that deploy to a single, well-known platform.Not ideal for: Production apps where you want explicit control over deployment configuration or need to customize adapter options.
Certain features are not available with adapter-auto because it cannot determine environment capabilities:
Copy
// These will throw errors with adapter-auto:import { read } from '$app/server';// Error: "The read function imported from $app/server only works // in certain environments. Since you're using @sveltejs/adapter-auto, // SvelteKit cannot determine whether it will work when your app is deployed."
If your app uses read from $app/server or instrumentation.server.js, you must use a specific adapter instead of adapter-auto.