clockworklabs/SpacetimeDB · error

spacetimedb_dir should be valid UTF-8

Error message

spacetimedb_dir should be valid UTF-8

What it means

Error "spacetimedb_dir should be valid UTF-8" thrown in clockworklabs/SpacetimeDB.

Source

Thrown at crates/cli/src/subcommands/dev.rs:1110

    }

    println!("{}", "Publishing...".cyan());

    // Loop through all publish configs
    for config_entry in publish_configs {
        let db_name = config_entry
            .get_config_value("database")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("database is a required field in publish config"))?;

        // Read module_path from each config entry, falling back to the shared spacetimedb_dir
        let entry_module_path = config_entry
            .get_config_value("module_path")
            .and_then(|v| v.as_str())
            .map(|s| s.to_string());
        let module_path_str = entry_module_path
            .as_deref()
            .unwrap_or_else(|| spacetimedb_dir.to_str().expect("spacetimedb_dir should be valid UTF-8"));

        if publish_configs.len() > 1 {
            println!("{} {}...", "Publishing to".cyan(), db_name.cyan().bold());
        }

        let mut publish_entry = HashMap::new();
        publish_entry.insert("database".to_string(), json!(db_name));
        publish_entry.insert("module-path".to_string(), json!(module_path_str));

        // Forward per-target server from config if set, or CLI server override
        if let Some(srv) = server {
            publish_entry.insert("server".to_string(), json!(srv));
        } else if let Some(srv) = config_entry.get_config_value("server").and_then(|v| v.as_str()) {
            publish_entry.insert("server".to_string(), json!(srv));
        }

        // Forward per-target build options if set
        if let Some(build_opts) = config_entry.get_config_value("build_options").and_then(|v| v.as_str())

View on GitHub (pinned to 524b4487d9)

When it happens

Trigger: Thrown at crates/cli/src/subcommands/dev.rs:1110 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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