Open rpock opened 2 days ago
I can confirm I've been able to reproduce, but with only two specials chars so far: #
and ?
, but other specials characters such as $
or %
work well. Which lead me to think there is something on with shell path escaping.
The binding to the container that run the edge-runtime
for bundling seems correct so the issue might actually come from the path normalization within the container bundling logic. I'm suspecting that maybe this is where things goes wrong: https://github.com/supabase/edge-runtime/blob/main/crates/sb_core/util/fs.rs#L208
Digging in, I've added debug logs to the edge-runtime
and can confirm this is a bug with some "url" characters within deno path utils, I've setup a branch with some debug logs locally: https://github.com/supabase/edge-runtime/commit/26c55e40d24919a778ad18605528fee61a96233d#diff-d8f56ede5ccc2924ccf7a18b57eb0e3867fc7804abbb922021bac99e64355d1b
And the actual issue arise within the fetch_local
function, this is the kind of debug output I got:
WARN: no seed files matched pattern: supabase/seed.sql
Bundling Function: my-function
DEBUG Opening cache /root/.cache/deno/dep_analysis_cache_v1...
DEBUG Opening cache /root/.cache/deno/node_analysis_cache_v1...
DEBUG Starting fetch_no_follow_with_options
DEBUG Input specifier: file:///Users/avallete/Programming/Supa/#cli/supabase/functions/my-function/index.ts
DEBUG Validating scheme
DEBUG Scheme is: file
DEBUG Checking permissions
DEBUG Permissions check passed
DEBUG Checking memory cache
DEBUG Not found in memory cache
DEBUG Handling file:// URL
DEBUG Starting fetch_local
DEBUG Input specifier: file:///Users/avallete/Programming/Supa/#cli/supabase/functions/my-function/index.ts
DEBUG Converting specifier to file path
DEBUG File path: "/Users/avallete/Programming/Supa/" <--- here we loose our proper path after to_file_path() is called
DEBUG Reading file bytes
DEBUG Failed to read file: Is a directory (os error 21)
Error 'Is a directory (os error 21)' contains boxed error of unknown type:
Os { code: 21, kind: IsADirectory, message: "Is a directory" }
Error: failed to create the graph
Caused by:
Is a directory (os error 21)
error running container: exit 1
Try rerunning the command with --debug to troubleshoot the error.
exit status 1
Describe the bug The Supabase CLI fails to deploy Edge Functions when the project path contains special characters (#). The error message suggests a directory issue, but the actual problem is the special characters in the path.
To Reproduce Steps to reproduce the behavior:
/Users/username/Documents/#project/#app/
)supabase functions new my-function
supabase functions deploy my-function --project-ref [your-project-ref]
Expected behavior Either:
Screenshots Error output:
Error output searchable:
System information
Docker Version: Latest
Additional context