Skip to content

Deno 2 deprecation warnings during edge function deployment (dx: low priority) #4266

@sbs44

Description

@sbs44

Describe the bug

When deploying edge functions, the CLI outputs Deno 2 deprecation warnings about --import-map and --decorator flags. While deployments succeed, these warnings clutter the output and indicate the CLI is using deprecated Deno command-line flags.

To Reproduce

  1. Create any edge function with a deno.json containing imports

  2. Configure import_map in supabase/config.toml:

    [functions.awesome-function]
    enabled = true
    verify_jwt = false
    import_map = "./functions/awesome-function/deno.json"
    entrypoint = "./functions/awesome-function/index.ts"
  3. Deploy the function: supabase functions deploy awesome-function --no-verify-jwt

  4. Observe deprecation warnings in output (see "Actual output", below)

Expected behavior

Edge functions should deploy without deprecation warnings (modern Deno 2 reads configuration from deno.json files automatically).

Actual output

Bundling Function: awesome-function
Specifying import_map through flags is no longer supported. Please use deno.json instead.
Specifying decorator through flags is no longer supported. Please use deno.json instead.
Deployed Functions on project abcdefghijklmnopq: awesome-function

System information

Rerun the failing command with --create-ticket flag.

  • Ticket ID: (FYI: adding "--create-ticket" flag does not output ticket ID)
  • Version of OS: macOS Tahoe 26.0.1
  • Version of CLI: 2.50.2 (beta)
  • Version of Docker: 28.4.0
  • Versions of services:
   SERVICE IMAGE          | LOCAL                  | LINKED     
  ------------------------|------------------------|------------
   supabase/postgres      | 17.6.1.005             | 17.6.1.005 
   supabase/gotrue        | v2.179.0               | v2.179.0   
   postgrest/postgrest    | v13.0.5                | v13.0.5    
   supabase/realtime      | v2.52.0                | -          
   supabase/storage-api   | v1.28.0                | -          
   supabase/edge-runtime  | v1.69.12               | -          
   supabase/studio        | 2025.10.06-sha-426fda2 | -          
   supabase/postgres-meta | v0.91.6                | -          
   supabase/logflare      | 1.22.4                 | -          
   supabase/supavisor     | 2.7.1                  | -          

Root Cause

The issue originates from hardcoded flags in pkg/function/bundle.go:

Lines 46-48:

BundleFlags = []string{
    "--decorator", "tc39",
}

Line 57:

if len(importMap) > 0 {
    args = append(args, "--import-map", importMap)
}

These flags are passed to edge-runtime, which passes them to Deno 2, triggering deprecation warnings.

Fix

Remove deprecated flags from pkg/function/bundle.go since Deno 2 automatically reads configuration from deno.json:

  1. Remove --decorator tc39 from BundleFlags
  2. Remove --import-map flag from bundling command

Backwards compatibility: Should be safe since edge functions already use deno.json files by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions