Skip to content

Deno 2 compile doesn't work on sveltekit (error: Module not found runtime/control.js) #26155

Open
@SerJaimeLannister

Description

Version: deno 2.0.0 (stable, release, x86_64-unknown-linux-gnu) (archlinux)
v8 12.9.202.13-rusty
typescript 5.6.2

Running deno compile on a sveltekit app returns a Module not found runtime/control.js error.

Steps to reproduce

  1. Run deno -A npm:create-svelte@latest my-app
    1.1. Click on Sveltekit demo app
    1.2. Yes using typescript syntax
    1.3. Selecting all the 5 options presented in the next step using space bar ) (Add eslint , prettier , vitest etc.)
  2. Run cd my-app
  3. Run deno install
  4. Run deno run dev (shows the expected sveltekit demo app at localhost:5173)
  5. Run deno install npm:svelte-adapter-deno
  6. Update svelte.config.js file to use Deno adapter:
// svelte.config.js
import adapter from 'svelte-adapter-deno';

export default {
  kit: {
    adapter: adapter()
  }
};
  1. Run deno run build to produce build folder and then cd into it (interestingly the last time I ran this it produced a mod.ts file but this time it didn't produce mod.ts I am not exactly sure what has changed since the last time) (this is extremely weird)
  2. but still running deno run index.js and giving it the permissions runs the sveltekit demo app
  3. Run deno compile build/server/index.js

Output:

error: Module not found "file:///home/test/Projects/deno/my-app/build/runtime/control.js".
    at file:///home/test/Projects/deno/my-app/build/server/index.js:1345:23

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlycompilerelated to the `deno compile` feature

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions