clockworklabs/SpacetimeDB · error
Server not specified and no default server configured.
Error message
Server not specified and no default server configured.
What it means
Thrown by `spacetime dev` when no server can be determined. The resolution chain is: explicit `--server` flag, then `default_server_name` from the global CLI config (`~/.local/share/spacetime/config.toml` or equivalent). If both are absent the command refuses to guess and bails. Note: unlike some other commands, `dev` does NOT silently fall back to `maincloud` or `local` for the server name itself.
Source
Thrown at crates/cli/src/subcommands/dev.rs:166
let project_path = args.get_one::<PathBuf>("project-path").unwrap();
let module_path_from_cli = args.get_one::<PathBuf>("module-path");
let module_bindings_path = args.get_one::<PathBuf>("module-bindings-path").unwrap();
let client_language = args.get_one::<Language>("client-lang");
let clear_database = args
.get_one::<ClearMode>("clear-database")
.copied()
.unwrap_or(ClearMode::OnConflict);
let force = args.get_flag("force");
// If you don't specify a server, we default to your default server
// If you don't have one of those, we default to "maincloud"
let server_from_cli = args.get_one::<String>("server").map(|s| s.as_str());
let default_server_name = config.default_server_name().map(|s| s.to_string());
let mut resolved_server = server_from_cli
.or(default_server_name.as_deref())
.ok_or_else(|| anyhow::anyhow!("Server not specified and no default server configured."))?;
let cwd = std::env::current_dir()?;
let mut project_dir = if project_path.is_absolute() {
project_path.clone()
} else {
cwd.join(project_path)
};
if module_bindings_path.is_absolute() {
anyhow::bail!("Module bindings path must be a relative path");
}
let mut module_bindings_dir = project_dir.join(module_bindings_path);
let mut spacetimedb_dir = match module_path_from_cli {
Some(path) => {
if path.is_absolute() {
path.clone()
} else {View on GitHub (pinned to 524b4487d9)
Solutions
- Pass the server explicitly: `spacetime dev --server local` (or `maincloud`)
- Set a persistent default once: `spacetime server set local http://localhost:3000 --use-as-default` (or `spacetime server set maincloud --use-as-default`)
- Verify with `spacetime server list` that a default exists and points where you expect
- In CI, always pass `--server` explicitly rather than relying on agent state
Example fix
# before spacetime dev # after spacetime dev --server local
Defensive patterns
Strategy: validation
Validate before calling
# Check a default server exists before running dev spacetime server list | grep -q default || spacetime server set local http://localhost:3000 --use-as-default
Prevention
- Run `spacetime server set ... --use-as-default` right after install
- In CI/containers, always pass `--server` explicitly
- Keep the global config out of .gitignore paths you actually need
When it happens
Trigger: Fresh install where `spacetime server list`/`spacetime login` was never run, running `spacetime dev` in a project whose `spacetime.json` has no `server` field and no global default server is set, or a corrupted/emptied global config file.
Common situations: New machine or CI container with no SpacetimeDB global config; user deleted config.toml; switching between `local` and `maincloud` setups without setting a default.
Related errors
- No such saved server configuration: {server} Add a new serve
- No default server configuration. Set an existing server as t
- Server nickname {} already in use: {}://{}
- Server host name is ambiguous with existing server nickname:
- Module bindings path must be a relative path
AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16).
Data as JSON: /api/errors/7c8421a1bb2b79c9.
Report an issue: GitHub.