sveltejs / sveltejs/kit

`@sveltejs/adapter-auto` not detecting Cloudflare Workers

Open
#15,060 3 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #13733 by @teemingc — merged
  • #14871 by @penalosa — closed without merging
pkg:adapter-auto pkg:adapter-cloudflare
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

In Cloudflare Workers, this combination:

  • .node-version file
  • no lockfile

Results in Node.js and bun install

Detected the following tools from environment: nodejs@24.12.0, bun@1.2.15
Installing nodejs 24.12.0
Installing project dependencies: bun install

Which fails to detect the production environment:

Using @sveltejs/adapter-auto
Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing
Reproduction

https://github.com/hyunbinseo/svelte-kit-template/tree/cloudflare-workers

Logs
2025-12-14T15:16:11.196Z	Initializing build environment...
2025-12-14T15:16:12.556Z	Success: Finished initializing build environment
2025-12-14T15:16:12.953Z	Cloning repository...
2025-12-14T15:16:13.931Z	No build output detected to cache. Skipping.
2025-12-14T15:16:13.931Z	No dependencies detected to cache. Skipping.
2025-12-14T15:16:20.389Z	Detected the following tools from environment: nodejs@24.12.0, bun@1.2.15
2025-12-14T15:16:20.390Z	Installing nodejs 24.12.0
2025-12-14T15:16:11.196Z	Initializing build environment...
2025-12-14T15:16:12.556Z	Success: Finished initializing build environment
2025-12-14T15:16:12.953Z	Cloning repository...
2025-12-14T15:16:13.931Z	No build output detected to cache. Skipping.
2025-12-14T15:16:13.931Z	No dependencies detected to cache. Skipping.
2025-12-14T15:16:20.389Z	Detected the following tools from environment: nodejs@24.12.0, bun@1.2.15
2025-12-14T15:16:20.390Z	Installing nodejs 24.12.0
2025-12-14T15:16:25.238Z	Installing project dependencies: bun install
2025-12-14T15:16:26.548Z	[3.55ms] ".env"
2025-12-14T15:16:26.557Z	bun install v1.2.15 (df017990)
2025-12-14T15:16:26.586Z	Resolving dependencies
2025-12-14T15:16:35.263Z	Resolved, downloaded and extracted [1100]
2025-12-14T15:16:36.469Z	Saved lockfile
2025-12-14T15:16:36.470Z	
2025-12-14T15:16:36.470Z	$ svelte-kit sync || echo ''
2025-12-14T15:16:37.511Z	
2025-12-14T15:16:37.513Z	+ @eslint/compat@2.0.0
2025-12-14T15:16:37.514Z	+ @eslint/js@9.39.2
2025-12-14T15:16:37.514Z	+ @sun-typeface/suit@2.0.5
2025-12-14T15:16:37.515Z	+ @sveltejs/adapter-auto@7.0.0
2025-12-14T15:16:37.515Z	+ @sveltejs/kit@2.49.2
2025-12-14T15:16:37.516Z	+ @sveltejs/vite-plugin-svelte@6.2.1
2025-12-14T15:16:37.518Z	+ @tailwindcss/forms@0.5.10
2025-12-14T15:16:37.518Z	+ @tailwindcss/vite@4.1.18
2025-12-14T15:16:37.519Z	+ @types/node@24.10.4 (v25.0.2 available)
2025-12-14T15:16:37.521Z	+ eslint@9.39.2
2025-12-14T15:16:37.521Z	+ eslint-config-prettier@10.1.8
2025-12-14T15:16:37.521Z	+ eslint-plugin-svelte@3.13.1
2025-12-14T15:16:37.521Z	+ globals@16.5.0
2025-12-14T15:16:37.524Z	+ jose@6.1.3
2025-12-14T15:16:37.527Z	+ prettier@3.7.4
2025-12-14T15:16:37.527Z	+ prettier-plugin-svelte@3.4.0
2025-12-14T15:16:37.528Z	+ prettier-plugin-tailwindcss@0.7.2
2025-12-14T15:16:37.528Z	+ svelte@5.46.0
2025-12-14T15:16:37.528Z	+ svelte-check@4.3.4
2025-12-14T15:16:37.530Z	+ tailwindcss@4.1.18
2025-12-14T15:16:37.530Z	+ typescript@5.9.3
2025-12-14T15:16:37.531Z	+ typescript-eslint@8.49.0
2025-12-14T15:16:37.531Z	+ valibot@1.2.0
2025-12-14T15:16:37.531Z	+ vite@7.2.7
2025-12-14T15:16:37.531Z	+ wrangler@4.54.0
2025-12-14T15:16:37.531Z	
2025-12-14T15:16:37.531Z	233 packages installed [12.14s]
2025-12-14T15:16:37.671Z	Executing user build command: node --run build
2025-12-14T15:16:48.470Z	vite v7.2.7 building ssr environment for production...
2025-12-14T15:16:48.514Z	transforming...
2025-12-14T15:16:49.743Z	✓ 206 modules transformed.
2025-12-14T15:16:49.846Z	rendering chunks...
2025-12-14T15:16:50.453Z	vite v7.2.7 building client environment for production...
2025-12-14T15:16:50.459Z	transforming...
2025-12-14T15:16:51.414Z	✓ 168 modules transformed.
2025-12-14T15:16:51.488Z	rendering chunks...
2025-12-14T15:16:51.548Z	computing gzip size...
2025-12-14T15:16:51.561Z	.svelte-kit/output/client/_app/version.json                                     0.03 kB │ gzip:  0.05 kB
2025-12-14T15:16:51.561Z	.svelte-kit/output/client/.vite/manifest.json                                   3.12 kB │ gzip:  0.63 kB
2025-12-14T15:16:51.561Z	.svelte-kit/output/client/_app/immutable/assets/SUIT-Variable.gqD86R3M.woff2  624.54 kB
2025-12-14T15:16:51.561Z	.svelte-kit/output/client/_app/immutable/assets/2.DbZHCSLt.css                  0.36 kB │ gzip:  0.24 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/assets/0.CHko16eK.css                 13.33 kB │ gzip:  3.54 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/entry/start.RWU3hlsv.js                0.08 kB │ gzip:  0.09 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/chunks/B7OwilHR.js                     0.11 kB │ gzip:  0.13 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/chunks/Ba1bqYIH.js                     0.18 kB │ gzip:  0.14 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/chunks/BiDYnakw.js                     0.35 kB │ gzip:  0.26 kB
2025-12-14T15:16:51.562Z	.svelte-kit/output/client/_app/immutable/nodes/1.AS4O5xbF.js                    0.86 kB │ gzip:  0.52 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/nodes/0.BcHLcWbe.js                    5.49 kB │ gzip:  2.90 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/entry/app.WWYurSqw.js                  6.52 kB │ gzip:  3.10 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/chunks/ChRcIiss.js                     6.52 kB │ gzip:  3.04 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/nodes/2.B6DGeXcR.js                   28.62 kB │ gzip: 11.51 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/chunks/DB_qSe21.js                    29.06 kB │ gzip: 11.39 kB
2025-12-14T15:16:51.563Z	.svelte-kit/output/client/_app/immutable/chunks/onhwaM3W.js                    33.62 kB │ gzip: 12.92 kB
2025-12-14T15:16:51.563Z	✓ built in 1.11s
2025-12-14T15:16:52.145Z	vite v7.2.7 building client environment for production...
2025-12-14T15:16:52.152Z	transforming...
2025-12-14T15:16:52.157Z	✓ 2 modules transformed.
2025-12-14T15:16:52.162Z	rendering chunks...
2025-12-14T15:16:52.163Z	computing gzip size...
2025-12-14T15:16:52.164Z	.svelte-kit/output/client/service-worker.mjs  1.17 kB │ gzip: 0.56 kB
2025-12-14T15:16:52.166Z	✓ built in 18ms
2025-12-14T15:16:52.166Z	.svelte-kit/output/server/.vite/manifest.json                                   4.69 kB
2025-12-14T15:16:52.166Z	.svelte-kit/output/server/_app/immutable/assets/SUIT-Variable.gqD86R3M.woff2  624.54 kB
2025-12-14T15:16:52.166Z	.svelte-kit/output/server/_app/immutable/assets/_page.DbZHCSLt.css              0.36 kB
2025-12-14T15:16:52.168Z	.svelte-kit/output/server/_app/immutable/assets/_layout.BwjYcKCn.css           13.35 kB
2025-12-14T15:16:52.168Z	.svelte-kit/output/server/entries/pages/_page.ts.js                             0.06 kB
2025-12-14T15:16:52.168Z	.svelte-kit/output/server/chunks/remote-14dkmo.js                               0.06 kB
2025-12-14T15:16:52.168Z	.svelte-kit/output/server/chunks/environment.js                                 0.19 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/equality.js                                    0.33 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/entries/fallbacks/error.svelte.js                     0.35 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/internal.js                                           0.38 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/server.js                                      0.48 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/index2.js                                      1.12 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/utils.js                                       1.15 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/ids.remote.js                                  1.22 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/hooks.server.js                                1.24 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/shared.js                                      1.34 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/entries/pages/_layout.svelte.js                       1.90 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/entries/pages/_page.svelte.js                         2.43 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/async.js                                       3.13 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/remote-entry.js                                       4.47 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/form.js                                        6.76 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/exports.js                                     6.97 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/query.js                                       8.36 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/form-utils.js                                 16.45 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/index.js                                      31.25 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/chunks/internal.js                                   76.48 kB
2025-12-14T15:16:52.169Z	.svelte-kit/output/server/index.js                                            126.61 kB
2025-12-14T15:16:52.170Z	✓ built in 3.67s
2025-12-14T15:16:52.170Z	
2025-12-14T15:16:52.170Z	Run npm run preview to preview your production build locally.
2025-12-14T15:16:52.174Z	
2025-12-14T15:16:52.174Z	> Using @sveltejs/adapter-auto
2025-12-14T15:16:52.174Z	  Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing
2025-12-14T15:16:52.174Z	  ✔ done
2025-12-14T15:16:52.260Z	Success: Build command completed
2025-12-14T15:16:52.412Z	Executing user deploy command: npx wrangler deploy
2025-12-14T15:16:53.813Z	
2025-12-14T15:16:53.813Z	 ⛅️ wrangler 4.54.0
2025-12-14T15:16:53.814Z	───────────────────
2025-12-14T15:16:53.834Z	
2025-12-14T15:16:53.886Z	✘ [ERROR] The entry-point file at ".svelte-kit/cloudflare/_worker.js" was not found.
2025-12-14T15:16:53.887Z	
2025-12-14T15:16:53.887Z	
2025-12-14T15:16:53.913Z	
2025-12-14T15:16:53.913Z	Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
2025-12-14T15:16:53.931Z	🪵  Logs were written to "/opt/buildhome/.config/.wrangler/logs/wrangler-2025-12-14_15-16-53_345.log"
2025-12-14T15:16:54.158Z	Failed: error occurred while running deploy command
System Info
CI
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and the @sveltejs/adapter-auto output, then run the Cloudflare build and npx wrangler deploy commands described in the logs. Trace why the Cloudflare environment is not detected when only .node-version is present and no lockfile exists. Done means the adapter detects Cloudflare Workers and generates .svelte-kit/cloudflare/_worker.js so deployment succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.