cli
cli copied to clipboard
Functions watcher Appears Not to Work
Bug report
Describe the bug
After running supabase functions serve
on a newly-created hello
function, I expect to see the function hot-reload after changing the index.ts
file of the function, but nothing seems to happen.
I see this message which indicates that serve
worked, but again, hot-reloading the function does not seem to work:
Starting supabase/functions/hello
Serving supabase/functions/hello
Watcher Process started.
Hello from Functions!
To Reproduce
- Run
supabase functions new hello
- Leave everything as-is in the
index.ts
file - Run
supabase start
- Run
supabase functions serve hello
- See 'Hello Functions!' printed - expected result.
- Make any change in index.ts - for this example I made a change to the output message
- 'Hello functions' is still printed, instead of the new output message. Also, there appears to be no status updates from the watcher.
Expected behavior
Expected the function to hot-reload.
System information
- OS: [e.g. macOS, Windows] Windows 11
- Browser (if applies) [e.g. chrome, safari] Independent
- Versions:
CLI version
0.24.2
, Deno:deno 1.20.4 (release, x86_64-pc-windows-msvc) v8 10.0.139.6 typescript 4.6.2
supabase-js:1.33.3
- Version of Node.js:
v16.14.0
Additional context
Tried running serve
from an Administrative Powershell and Admin. CMD - same result.
This seems to be a limitation of Docker on Windows: https://forums.docker.com/t/file-system-watch-does-not-work-with-mounted-volumes/12038
The workaround mentioned in that thread is to do the file watching ourselves natively, but that involves a lot of work - happy to hear any alternatives.
Facing the same issue...
There's an old post that works for others but I can't get this to work. Anyone more luck?
http://blog.subjectify.us/miscellaneous/2017/04/24/docker-for-windows-watch-bindings.html
@soedirgo This seems to be caused by the incorrect path being exposed:
WARNING:root:Bind of container supabase_deno_relay_edge-functions was skipped since it has invalid source path C:\supabase\examples\edge-functions/supabase/functions
Notice the change in backslash to slash. The Python script would work if the mount would be 'correct'
EDIT: I did it! AAAAAAH! This makes my life so much easier dealing with Edge Functions. Wow.
Serving supabase/functions/select-from-table-with-auth-rls
Watcher Process started.
Function "select-from-table-with-auth-rls" up and running!
Watcher File change detected! Restarting!
Check file:///home/deno/functions/select-from-table-with-auth-rls/index.ts
Function "select-from-table-with-auth-rls" up and running!
Watcher File change detected! Restarting!
Function "select-from-table-with-auth-rls" up and running!
Steps to get to the same outcome:
- Go to https://github.com/merofeev/docker-windows-volume-watcher and download the source
- Change the file
container_monitor.py
to the following contents: https://pastebin.com/raw/07uxv9gG You can read more about these changes in this issue: https://github.com/merofeev/docker-windows-volume-watcher/issues/18 - Download auto-py-to-exe here https://github.com/brentvollebregt/auto-py-to-exe
- Start auto-py-to-exe and create a new exe file from the cli.py file
- Start the cli.exe
- Success!
Good find! The mount path thing is a bug - will work on a fix.
hey , a guest from the dystopian '23 here 😀.
the issue still persists on docker windows. any chance for a patch in the cli?
Hi! Just here to ask for any updates in the issue. Still persist up to date.
I hate to do this, but I third the request to prioritize fixing this issue.
issue on Docker macOs too
Still facing this issue on Mac. Even stopping/restarting supabase does not pickup new function changes. @Bijig0 did you ever solve for mac?
Still facing this issue on Mac. Even stopping/restarting supabase does not pickup new function changes. @Bijig0 did you ever solve for mac?
Unfortunately not, I personally switched to vercel cloud functions
I can confirm that I'm experiencing the same issues. A full Docker restart is required to run updates locally on mac.
Docker Desktop 4.30.0 supabase/postgres 15.1.1.33 supabase/edge-runtime 1.45.2