Skip to content

SvelteKit support

Deploy a SvelteKit 2 or 3 application built with Vite, with static assets and server rendering on Cloudflare.

View as Markdown

Next.js is Arkor's recommended framework and the main focus of its performance work. Its Partial Prerendering and caching integration serves a cached shell before dynamic rendering completes. SvelteKit is also supported, with its usual static generation and server rendering.

Deploy from GitHub

Import your repository as in the Quickstart. Set the root directory to the SvelteKit app, such as . or apps/site. Arkor detects Next.js first when that directory declares both frameworks; select the SvelteKit app's own directory in a mixed monorepo.

SvelteKit 2 and 3 projects build with Vite. The package manager and install command are detected from your repository. Arkor runs your existing build script with that package manager; without one, it runs vite build. A project's custom build command must also complete the Vite build in the selected root directory.

Keep your existing official adapter configuration, dependencies, lockfile and build command. Arkor selects the deployment output during the build:

Existing official adapterDeployment on Arkor
@sveltejs/adapter-autoA compatible official Cloudflare adapter is selected automatically.
@sveltejs/adapter-cloudflareExisting Cloudflare Worker and Pages output is supported.
@sveltejs/adapter-node, @sveltejs/adapter-vercel, @sveltejs/adapter-netlifyThe app is rebuilt with a compatible official Cloudflare adapter.
@sveltejs/adapter-bunThe app is rebuilt with the official Cloudflare adapter; SvelteKit 3 only.
@sveltejs/adapter-staticThe installed Static adapter produces a static deployment, including its configured SPA fallback.

The adapter must be compatible with your installed SvelteKit major version. Both Node and Bun build execution are supported, including an existing bun run --bun build command. Hosted SvelteKit installation and build commands select Bun 1.4.4 automatically when they use Bun. Local SvelteKit 3 builds require Bun 1.4 or newer; Node.js 24 is also supported. Using Bun to build does not provide Bun's server runtime APIs in the deployed Worker. See the official Bun adapter documentation.

When migrating a server adapter, host-specific output options such as out, envPrefix, regions and function splitting are not forwarded to the Cloudflare adapter. The build log lists ignored options. Arkor supplies separate Cloudflare build configuration for these migrations; an unrelated Wrangler file in the repository is not imported. Explicit Cloudflare adapter configuration keeps its existing behavior.

Existing Pages-style Wrangler configurations using pages_build_output_dir retain the adapter's generated function routing rules, with exclusions taking priority over inclusions. Arkor deploys the application with Cloudflare Workers and static assets. Configure bindings and resources in Arkor; settings from an existing Pages project are not imported. See the official adapter's routing options.

SvelteKit 3 configures the adapter in vite.config.js or vite.config.ts. SvelteKit 2 can also use its existing svelte.config.js. Arkor's automatic adapter selection works at build time without changing those source files. See the official SvelteKit 3 migration guide.

Static deployments

The Static adapter keeps its prerender checks and strict behavior. Without a fallback, the default validation fails if required routes were not prerendered. strict: false permits incomplete static output; missing routes still return 404, and Arkor does not enable SSR for them.

A configured fallback serves the generated SPA HTML for missing GET and HEAD paths within the app's base path. Arbitrary fallback filenames, such as 200.html, work alongside a separately prerendered homepage. Without a fallback, missing paths return 404. Static deployments publish no application server: dynamic endpoints and form actions are unavailable, and other HTTP methods within the base path return 405. Every method outside that base returns 404. See the official Static adapter documentation.

Without an SPA fallback, published 404.html pages use Cloudflare's nearest-directory error page handling, including nested pages without a root error page. The private Static build disables precompress so generated .br and .gz siblings do not consume native asset upload slots. Your source configuration and explicitly authored compressed files are preserved.

Delivery and performance

Cloudflare serves static assets and prerendered pages. In server-rendered deployments, dynamic pages, endpoints and form actions run in the application's Worker using the official adapter. Dynamic responses retain the framework's behavior; Arkor does not turn personalized SSR responses into shared cached pages.

SvelteKit does not use Next.js's cached-shell resume, Cache Components or ISR integration. A dynamic SvelteKit page starts answering when its Worker can produce the response. For applications that need a public shell before dynamic work finishes, choose Next.js with Partial Prerendering.

The build page reports the actual SvelteKit version and static asset count. The detailed route tree and runtime cache inspection are Next.js features. Next.js setup snippets for analytics and other integrations should not be copied into a Svelte component.

Runtime compatibility

Automatic migration covers the official adapters listed above. Community or custom adapters, custom servers, provider SDKs and provider infrastructure are not automatically converted. Review code that depends on Vercel, Netlify, Node server or Bun platform context, and configure the Cloudflare resources it needs in Arkor.

Custom wrappers around an official adapter also require an explicit migration. Shared configuration packages may re-export the official adapter without changing its returned adapter object.

Node.js imports are supported where Workers implements the API; they are not rejected simply for using node:. For example, Workers supports node:fs through a virtual file system with bundled read-only files and request-local temporary storage. This does not port a persistent host file system, native addons or operating-system child processes. Check Cloudflare's Node.js compatibility and file system documentation for the APIs your dependencies use.

Workers for Platforms isolates each application Worker. Its caches.default API is unavailable; use await caches.open('your-cache-name') in your own Worker code. Arkor automatically adapts the official SvelteKit 2 Cloudflare adapter's response cache to an isolated named cache, preserving its cache rules. Native static asset delivery continues to use Cloudflare's asset cache. See Cloudflare's Worker isolation.

Active Vercel ISR and image optimization require an explicit migration. Builds also reject known Vercel delivery settings in vercel.json and vercel.toml, including routes, headers, redirects, rewrites, crons, trailingSlash and cleanUrls. Arkor stops before publication rather than silently dropping those behaviors. ISR settings on a route that is fully prerendered have no runtime effect and do not block deployment.

Build-only settings in static JSON or TOML do not block migration. Programmatic Vercel configuration (vercel.ts, vercel.mts, vercel.js, vercel.mjs, or vercel.cjs) needs an explicit migration: Arkor does not evaluate these additional provider-specific files and stops before publication. Multiple Vercel configuration files are also rejected, matching Vercel's one-file requirement. See Vercel's configuration formats.

Active Netlify delivery settings in netlify.toml, including redirects, rewrites, proxies, headers, edge-function routing and enabled Pretty URLs processing, also require an explicit migration. Empty delivery declarations and ordinary build settings do not block deployment. These provider settings are not copied into the private Cloudflare configuration. See Netlify's file-based configuration.

Static asset configuration

Put _headers and _redirects in the project root, as required by the official adapter. Their rules apply to static asset responses. Set headers and redirects for dynamically rendered responses in SvelteKit endpoints or hooks. See the adapter's headers and redirects documentation.

Cloudflare supports up to 100 _headers rules. With adapter-static, when all slots are used, Arkor preserves every customer rule and omits its optional immutable-asset browser-cache default unless it fits an existing selector. Cloudflare's asset cache still serves these files. To set browser caching in this case, include Cache-Control in an existing immutable-assets rule.

An .assetsignore file is read from the root of the generated Cloudflare assets directory, with patterns relative to that directory. When kit.paths.base places files under a subdirectory, include that prefix in the patterns; nested .assetsignore files do not establish separate ignore roots. Check the generated output when using a base path. See Cloudflare's asset ignore rules.

Build failures

Check the selected root directory, the installed SvelteKit version, and the adapter's peer dependencies. A custom build command must leave the expected adapter output. The build log records the command and the detected framework. See Troubleshooting.

Custom Pages routing must let Arkor validate a reachable Worker route or establish that every route is asset-only. If it cannot do either, deployment stops with an explicit routing error.