clockworklabs/SpacetimeDB · error · anyhow::Error

Project path does not exist: {}

Error message

Project path does not exist: {}

What it means

publish validates that the resolved project path exists on disk before building, and errors out with the offending path otherwise (publish.rs:542). The path comes from --project-path on the CLI or the project-path/module-path setting in spacetime.json.

Source

Thrown at crates/cli/src/subcommands/publish.rs:542

        let dotnet_version = if command_config.is_from_cli("dotnet_version") {
            command_config.get_one::<u8>("dotnet_version")?
        } else {
            let dotnet_version = command_config.get_one::<String>("dotnet_version")?;
            parse_optional_dotnet_version(dotnet_version.as_deref())?
        };

        // If the user didn't specify an identity and we didn't specify an anonymous identity, then
        // we want to use the default identity
        // TODO(jdetter): We should maybe have some sort of user prompt here for them to be able to
        //  easily create a new identity with an email
        let auth_header = get_auth_header(config, anon_identity, server, !yes.skip_login).await?;

        let (name_or_identity, parent) = validate_name_and_parent(name_or_identity, parent)?;

        if let Some(path_to_project) = path_to_project.as_ref()
            && !path_to_project.exists()
        {
            return Err(anyhow::anyhow!(
                "Project path does not exist: {}",
                path_to_project.display()
            ));
        }

        // Decide program file path and read program.
        // Optionally build the program.
        let (path_to_program, host_type) = if let Some(path) = wasm_file {
            println!("(WASM) Skipping build. Instead we are publishing {}", path.display());
            (path.clone(), "Wasm")
        } else if let Some(path) = js_file {
            println!("(JS) Skipping build. Instead we are publishing {}", path.display());
            (path.clone(), "Js")
        } else {
            build::exec_with_argstring(
                path_to_project
                    .as_ref()
                    .expect("path_to_project must exist when publishing from source"),

View on GitHub (pinned to 524b4487d9)

Solutions

  1. Verify the path exists: `ls <path>`
  2. Use an absolute path, or run publish from the module directory
  3. Fix the project-path/module-path field in spacetime.json
  4. Recreate the directory or regenerate the project if it was deleted

Example fix

// before
spacetime publish --project-path ./server
// after
spacetime publish --project-path /abs/path/to/server
Defensive patterns

Strategy: validation

Validate before calling

[ -e "$PROJECT_PATH" ] || { echo "no such path: $PROJECT_PATH" >&2; exit 2; }
spacetime publish --project-path "$PROJECT_PATH"

Type guard

fn project_path_exists(p: &std::path::Path) -> bool { p.exists() }

Prevention

When it happens

Trigger: `spacetime publish --project-path ./missing`, or a spacetime.json project-path that no longer resolves from the current working directory.

Common situations: Wrong working directory (relative paths silently changing meaning); stale paths in spacetime.json after moving or renaming the project; typos; deleted build directories.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/1e5ff860676ab6fc. Report an issue: GitHub.