cli icon indicating copy to clipboard operation
cli copied to clipboard

fix: throw error when static_files are used with --use-docker but Docker isn't running

Open 7ttp opened this issue 1 month ago • 4 comments

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

7ttp avatar Nov 30 '25 22:11 7ttp

@sweatybridge Please review, when available!

7ttp avatar Nov 30 '25 22:11 7ttp

Deploying static files in non-docker mode is supported. Can you reproduce the issue and verify?

sweatybridge avatar Dec 01 '25 02:12 sweatybridge

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-docker and 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.

7ttp avatar Dec 01 '25 07:12 7ttp

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.

sweatybridge avatar Dec 01 '25 08:12 sweatybridge