Files
supabase/apps/docs/content/troubleshooting/issues-serving-edge-functions-locally.mdx
T
Wen Bo Xie ffd2754c7a docs(cli): document experimental supabase stack commands and native runtime (#50391)
Add two guides under Local Development for the experimental `supabase
stack` commands, wire them into the docs nav, the CLI reference, the
marketing features list, and the pages that readers reach with a port
conflict.

New pages:
- guides/local-development/parallel-projects: run one local project per
app, git worktree, branch, or named environment on a single machine.
Covers identity, automatic port assignment, removing fixed ports from
config.toml, named projects, finding endpoints, stop and destroy, the
`[experimental] stack` setting, and current limitations.
- guides/local-development/runtimes: the Docker and native runtimes, how
the CLI picks one, native platform requirements, artifact download and
cache locations, and runtime limitations.

Cross-links and context:
- Local development index, CLI getting started, CLI workflows, managing
environments, AI tools, MCP, and the edge functions port troubleshooting
entry now point readers to the new guides where a second `supabase
start` fails on a port conflict.
- CLI reference: `supabase stack`, `stack start`, `stack stop`, `stack
destroy`, the `experimental.stack` config key, and a note on `supabase
start` and `[experimental] stack`.
- www: two feature entries and copy tweaks on the hosted Postgres and
innovation teams solution pages.
- supa-mdx-lint: allow worktree, glibc, musl, and checksum.
2026-10-02 08:39:18 +02:00

75 lines
2.4 KiB
Plaintext

---
title = "Issues serving Edge Functions locally"
topics = [ "functions", "cli" ]
keywords = [ "local", "serve", "development", "debug", "port", "edge function" ]
database_id = "1cff12df-7ad6-48c5-b518-5ea468b54bab"
[api]
cli = [ "supabase-functions-serve" ]
---
If `supabase functions serve` fails or you're having trouble running Edge Functions locally, follow these steps to diagnose and resolve the issue.
## Debugging steps
### Use debug mode
Run the serve command with the `--debug` flag for detailed output:
```bash
supabase functions serve your-function --debug
```
### Check port availability
Ensure the required ports are available. The Supabase CLI uses ports `54321` and `8081` by default:
```bash
# Check if port 54321 is in use
lsof -i :54321
# Check if port 8081 is in use
lsof -i :8081
```
If these ports are in use, stop the processes using them or configure different ports.
## Common issues
### Port conflicts
Another process may be using the required ports. Check for:
- Other Supabase projects running locally
- Docker containers
- Other development servers
If the conflict comes from another Supabase project, run both projects at the same time with the experimental `supabase stack` commands. They assign each local project its own ports. Turn on the commands and remove the fixed ports from each project's `config.toml` first. See [Running multiple local projects](/docs/guides/local-development/running-multiple-local-projects).
### Deno cache issues
Clear the Deno cache if you're experiencing module resolution problems:
```bash
deno cache --reload /path/to/function/index.ts
```
### Environment variables
Make sure your `.env` file is properly configured and accessible to the CLI.
## Getting more help
If the problem persists, search the following repositories for similar error messages:
- [Edge Runtime repository](https://github.com/supabase/edge-runtime)
- [CLI repository](https://github.com/supabase/cli)
If the output from these commands does not help resolve the issue, open a support ticket via the Supabase Dashboard (by clicking the "Help" button at the top right) and include all output and details about your commands.
## Additional resources
- [Local development guide](/docs/guides/local-development/database-migrations)
- [Edge Functions quickstart](/docs/guides/functions/quickstart)
- [Debugging Edge Functions](/docs/guides/functions/logging)