deno
deno copied to clipboard
Support for SvelteKit
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).