fix: throw error when static_files are used with --use-docker but Docker isn't running
when deploying edge functions with static_files configured and --use-docker is specified while docker is not running, the cli silently falls back to the native bundler. this causes static files to be ignored, since the native bundler requires the edge runtime to be installed locally for static file bundling.
without --use-docker, static files are bundled correctly. with --use-docker and docker stopped, the deploy still succeeds but the static files are missing. so the issue only appears when a user explicitly requests docker bundling but docker isn’t available.
this change adds a check that returns an explicit error when static_files is configured, --use-docker is used, and docker is unavailable, instead of silently producing an incomplete deploy.
closes #4554
@sweatybridge Please review, when available!
Deploying static files in non-docker mode is supported. Can you reproduce the issue and verify?
Deploying static files in non-docker mode is supported. Can you reproduce the issue and verify?
Thanks for the review @sweatybridge !! retested with the correct paths:
- Without
--use-docker: static files bundled correctly - With
--use-dockerand Docker stopped: deploy succeeds but static files are missing
So the problem is specifically when a user explicitly requests Docker bundling but Docker isn’t available. The current behaviour silently produces an incomplete deploy. This PR makes that failure explicit by returning an error when --use-docker is specified, Docker isn't running, and static_files is configured.
With --use-docker and Docker stopped: deploy succeeds but static files are missing
This code path falls back to deploy using API, which is the same as running supabase functions deploy --use-api.
If static files don't work with --use-api flag, we should find the bug and fix it. Because as I said, this is a supported feature.