Skip to content

deploy_edge_function reuses a removed import map on redeploy #587

Done

Description

@hsusul

What happens

When deploy_edge_function redeploys an existing function, it can send an import_map_path that does not name a file in the new upload. This happens when the upload replaces the old import map and the caller leaves import_map_path unset.

Reproduction

  1. Start with an Edge Function deployed with import_map.json.
  2. Call deploy_edge_function for the same function. Send index.ts, deno.jsonc, and any dependencies. Leave out both import_map.json and the import_map_path argument.
  3. Inspect the multipart request to the Management API. The metadata names import_map.json, but the form only includes the new files.

I reproduced the request in Node 24 using the upstream deployEdgeFunction implementation with a mocked Management API. The implicit call sent import_map.json. Passing import_map_path: "deno.jsonc" explicitly sent the correct path. I did not test a hosted deployment.

Expected behavior

An explicit path should still win. If the caller does not specify a path, the tool should reuse the previous import map only when that file is in the new upload. Otherwise it should apply its existing file detection to the new upload.

The current fallback prefers the old metadata without checking the new files. #559 fixed deno.jsonc detection when no previous map is set, so it does not cover this redeploy case.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    56093a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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