sveltejs/kit · warning

Detected ${platform.name}. Please remove adapter-static opti

Error message

Detected ${platform.name}. Please remove adapter-static options to enable zero-config mode

What it means

adapter-static detects hosting platforms (e.g. GitHub Pages, Netlify) and offers a zero-config mode where platform-specific pages/paths are inferred automatically. If explicit adapter-static options are also supplied, they may conflict with the inferred settings, so the adapter warns you to remove them to benefit from zero-config detection.

Source

Thrown at packages/adapter-static/index.js:58

					);

					builder.log(
						`If this doesn't help, you may need to use a different adapter. @sveltejs/adapter-static can only be used for sites that don't need a server for dynamic rendering, and can run on just a static file server.\n`
					);

					builder.log(`See https://svelte.dev/docs/kit/page-options#prerender for more details\n`);

					const error = new Error('Encountered dynamic routes');
					error.stack = '';
					throw error;
				}
			}

			const platform = platforms.find((platform) => platform.test());

			if (platform) {
				if (options) {
					builder.log.warn(
						`Detected ${platform.name}. Please remove adapter-static options to enable zero-config mode`
					);
				} else {
					builder.log.info(`Detected ${platform.name}, using zero-config mode`);
				}
			}

			const {
				pages = 'build',
				assets = pages,
				fallback,
				precompress
			} = options ?? platform?.defaults ?? /** @type {import('./index.js').AdapterOptions} */ ({});

			rmSync(assets, { force: true, recursive: true });
			rmSync(pages, { force: true, recursive: true });

			builder.generateEnvModule();

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Remove the options object: use `adapter()` with no arguments so zero-config mode takes over.
  2. If you intentionally need custom options, ignore the warning and keep them (they take precedence).
  3. Set `paths`/`fallback` needs inside netlify.toml / GitHub Pages config instead of adapter options where the platform supports it.

Example fix

// before (svelte.config.js)
adapter({ pages: 'build', assets: 'build', fallback: undefined })
// after
adapter()
Defensive patterns

Strategy: validation

Validate before calling

const isZeroConfigTarget = !!process.env.GITHUB_ACTIONS || !!process.env.NETLIFY;
if (isZeroConfigTarget && adapterOptionsProvided) {
  console.warn('Remove adapter-static options to enable zero-config mode on this platform');
}

Prevention

When it happens

Trigger: Calling adapt() with adapter-static while: (1) a known platform environment variable is detected by one of the platform test() predicates, AND (2) non-empty `options` were passed to the adapter.

Common situations: Deploying to GitHub Pages with a workflow setting CI env vars while keeping `pages: 'build'` or `fallback` options from an earlier setup; copy-pasted adapter config from a non-platform deployment; migration from manual to zero-config mode left stale options.

Related errors


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/aec13af27ccb8959. Report an issue: GitHub.