You can now try Deno 2.1 locally with Supabase CLI. The goal of local preview is to identify any regressions or missing functionality before we upgrade hosted version to Deno 2.1.
The hosted version still uses Deno 1.4+, and if you deploy functions written with Deno 2.1, some of the features may not work.
UPDATE 04/09/25: hosted version is now using Deno 2.1 - https://github.com/orgs/supabase/discussions/37941
How to try#
-
Install Deno 2.1 or newer version on your machine (https://docs.deno.com/runtime/getting_started/installation/)
-
Go to your Supabase project.
cd my-supabase-project -
Open
supabase/config.tomland setdeno_version = 2
_10[edge_runtime]_10deno_version = 2
- All your existing functions should work as before.
*To scaffold a new function as a Deno 2 project:
_10deno init --serve hello-world
- Open
supabase/config.tomland add the following:
_10[functions.hello-world]_10entrypoint = "./functions/hello-world/main.ts"
- Open supabase/functions/hello-world/main.ts and modify line 10 to:
_10if (url.pathname === "/hello-world") {
-
Use
npx supabase@beta functions serve --no-verify-jwtto start the dev server. -
To run built-in tests,
cd supabase/functions/hello-world; deno test
Please give it a try and report any bugs and feedback.