Skip to content

supabase functions deploy fails #1739

Closed

Description

@bombillazo

Describe the bug
On CLI 1.123.3 (at least), deploying functions fails. Reverting back to 1.119.1 works. We have not tried intermediary versions.

To Reproduce
Steps to reproduce the behavior:

  1. Run supabase functions deploy my_function --project-ref $PROJECT
  2. Get error:
Error: failed to load 'file:///home/deno/modules/3ca66d1b34d0b8876071c82bf7b01713844dc25fc70c7bc0de4faefd13fe8919': Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
  Specifier: file:///home/deno/modules/3ca66d1b34d0b8876071c82bf7b01713844dc25fc70c7bc0de4faefd13fe8919

Expected behavior
Deploy runs successfully.

  • Version of CLI 1.123.3

Activity

  1. laktek commented on Dec 12, 2023

    @laktek
    Contributor

    @bombillazo What's the file structure in your supabase/functions directory? Is there a file by the name3ca66d1b34d0b8876071c82bf7b01713844dc25fc70c7bc0de4faefd13fe8919?

  2. sweatybridge commented on Dec 12, 2023

    @sweatybridge
    Contributor

    It's probably a problem with the way we resolve import maps for absolute file paths. Here's a reproducible example:

    Given the following import_map.json

    {
      "imports": {
        "http-server": "https://deno.land/[email protected]/http/server.ts",
        "shared_abs": "../shared/index.ts",
        "shared/": "../shared/"
      }
    }
    

    Importing shared/index.ts works but not shared_abs. We can probably fix it by adding the original file extension to the resolved path.

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