supabase / edge-runtime

A server based on Deno runtime, capable of running JavaScript, TypeScript, and WASM services.
MIT License
680 stars 62 forks source link

Functions download throwing rust error on windows PC #252

Open lucas-codes-stuff opened 10 months ago

lucas-codes-stuff commented 10 months ago

Describe the bug Currently trying to download a function from my Supabase project and it's throwing a strange error no matter what I do

Error states:

thread 'main' panicked at crates/sb_graph/lib.rs:144:61: called Result::unwrap() on an Err value: StripPrefixError(()) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace error running container: exit 101 Try rerunning the command with --debug to troubleshoot the error.

To Reproduce Steps to reproduce the behavior:

  1. init and login to supabase cli
  2. download function from online project
  3. error throws

Expected behavior The function is downloaded locally

Screenshots image

Desktop (please complete the following information):

sweatybridge commented 10 months ago

Could you run supabase functions download userAdd --create-ticket to send a crash report? It helps us collect context information to help reproduce.

nyannyacha commented 9 months ago

Note: This is probably due to a Windows path separator being in the argument.

nyannyacha commented 9 months ago

https://github.com/supabase/cli/blob/main/internal/functions/download/download.go#L169 https://github.com/supabase/edge-runtime/blob/main/crates/sb_graph/lib.rs#L144

nyannyacha commented 9 months ago
fn main() {
    let x = Path::new("\\aaa\\aa");

    dbg!(x.strip_prefix("/"));
}
[src/main.rs:6] x.strip_prefix("/") = Err(
    StripPrefixError(
        (),
    ),
)