fix(compile): detect svelte-adapter-deno build output#34535
Merged
Conversation
Framework detection for `deno compile <dir>` mapped any svelte.config that referenced `svelte-adapter-deno` to a Nitro-style `.output/server/index.mjs` entrypoint. That adapter actually emits a `build/` directory (`build/index.js` boots the server, `build/handler.js` serves static assets from sibling `client`/`static`/`prerendered` dirs), so compilation failed with a missing `.output` module, and even when worked around the static assets 404'd at runtime because they were never embedded. Detect the `build/index.js` + `build/handler.js` output shape (and the `svelte-adapter-deno` config) and generate a `./build/index.js` entrypoint, including the existing `build/client`, `build/static` and `build/prerendered` asset directories so the compiled binary serves them. Fixes #26155
The svelte-adapter-deno build output references Node types that aren't resolvable from the bundle, so type checking the generated entrypoint fails with a '@types/node' resolution error. Disable type checking for SvelteKit the same way it is already done for Next.js, so `deno compile <dir>` works without requiring `--no-check`.
bartlomieju
enabled auto-merge (squash)
May 30, 2026 06:41
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
Framework detection for compiling a directory mapped any SvelteKit project whose svelte.config referenced svelte-adapter-deno to a Nitro-style .output/server/index.mjs entrypoint. That adapter does not use Nitro; it emits a build/ directory where build/index.js boots the server and build/handler.js serves static assets from sibling client, static and prerendered directories. As a result deno compile on such a project failed with a missing .output module, and the older workaround of compiling build/index.js directly produced a server that returned 404 for every asset because the static directories were never embedded in the binary. This detects the build/index.js plus build/handler.js output shape (and the svelte-adapter-deno config when there is no build yet) and generates a ./build/index.js entrypoint, including the build/client, build/static and build/prerendered directories that exist so the compiled binary can serve them. It also disables Deno type checking for SvelteKit, the same way it is already done for Next.js, because the adapter's bundled output references Node types that aren't resolvable from the build and would otherwise fail type checking. With both changes, deno compile ./my-app just works with no extra flags. Verified end to end against a scaffolded SvelteKit app: the resulting binary serves the page, static files and the immutable client assets. Fixes denoland#26155
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Framework detection for compiling a directory mapped any SvelteKit project
whose svelte.config referenced svelte-adapter-deno to a Nitro-style
.output/server/index.mjs entrypoint. That adapter does not use Nitro; it emits
a build/ directory where build/index.js boots the server and build/handler.js
serves static assets from sibling client, static and prerendered directories.
As a result deno compile on such a project failed with a missing .output
module, and the older workaround of compiling build/index.js directly produced
a server that returned 404 for every asset because the static directories were
never embedded in the binary.
This detects the build/index.js plus build/handler.js output shape (and the
svelte-adapter-deno config when there is no build yet) and generates a
./build/index.js entrypoint, including the build/client, build/static and
build/prerendered directories that exist so the compiled binary can serve
them.
It also disables Deno type checking for SvelteKit, the same way it is already
done for Next.js, because the adapter's bundled output references Node types
that aren't resolvable from the build and would otherwise fail type checking.
With both changes, deno compile ./my-app just works with no extra flags.
Verified end to end against a scaffolded SvelteKit app: the resulting binary
serves the page, static files and the immutable client assets.
Fixes #26155