Skip to content

deploy_edge_function ignores deno.jsonc when choosing a default import map #558

Closed

Description

@officialasishkumar

Description

deploy_edge_function picks a default import map when import_map_path isn't passed and the function doesn't already have one. That heuristic (deployEdgeFunction in packages/mcp-server-supabase/src/platform/api-platform.ts) only recognises deno.json and import_map.json:

const import_map_file = inputFiles.find((file) =>
  ['deno.json', 'import_map.json'].includes(file.name)
);

This causes two problems:

  1. deno.jsonc is ignored. The files parameter description tells agents to "Include the deno.json and deno.jsonc files to configure the Deno runtime (e.g., compiler options, imports) if they exist", but a function whose config is deno.jsonc deploys with no import_map_path. Its imports aren't applied, so bare specifiers that resolve locally fail at runtime after deployment.
  2. The choice depends on file order. If files contains both import_map.json and deno.json, whichever comes first wins. The Supabase CLI always prefers deno.json, then deno.jsonc (apps/cli/src/shared/functions/deploy.ts in supabase/cli).

Steps to reproduce

Call deploy_edge_function for a new function with:

{
  "name": "hello-world",
  "files": [
    { "name": "index.ts", "content": "import { x } from 'my-dep'; ..." },
    { "name": "deno.jsonc", "content": "{ \"imports\": { \"my-dep\": \"npm:...\" } }" }
  ]
}

Expected behavior

The function deploys with import_map_path set to deno.jsonc, as it would through supabase functions deploy. If several config files are present, the server uses deno.json, then deno.jsonc, then import_map.json, regardless of their order in files.

Actual behavior

The function deploys without an import map (import_map: false). With both import_map.json and deno.json present, the result depends on array order.

Activity

  1. added a commit that references this issue on Nov 17, 2026
    16bde19
  2. self-assigned this
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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