Skip to content

Support for SvelteKit #17248

@bartlomieju

Description

@bartlomieju

Prompted by discussion on Discord I tried to get SvelteKit working in Deno.

After an hour of debugging I found the main blocker: by default SvelteKit installed Node adapter, which does a bit of setup that is not needed in Deno and makes the project crash, namely:
https://github.com/sveltejs/kit/blob/e7bc0be2b25aff5ac151e3d83b771ad80cac1ab8/packages/kit/src/exports/node/polyfills.js#L6-L28
which installs polyfills from undici for various Web APIs like fetch or Response. These objects work slightly differently in Deno and arguably installing them in Deno is not needed.

I think the way forward would be to get a Deno dedicated adapter that would essentially be a noop as there's no need to change anything to make SvelteKit work.

Of course it would be very nice if deno run -A npm:create-svelte@latest would set up a project in a way that requires no changes (namely making specifiers use npm: prefixes).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions