clockworklabs/SpacetimeDB · error · anyhow::Error

Found {err_count} disallowed print statement(s). These will

Error message

Found {err_count} disallowed print statement(s).
These will not be printed from SpacetimeDB modules.
If you need to print something, use the `log` crate
and the `log::info!` macro instead.

What it means

Error "Found {err_count} disallowed print statement(s). These will not be printed from SpacetimeDB modules. If you need to print something, use the `log` crate and the `log::info!` macro instead." thrown in clockworklabs/SpacetimeDB.

Source

Thrown at crates/cli/src/tasks/rust.rs:68

                let file = fs::File::open(file.path())?;
                for (idx, line) in io::BufReader::new(file).lines().enumerate() {
                    let line = line?;
                    let line_number = idx + 1;
                    for disallowed in &["println!", "print!", "eprintln!", "eprint!", "dbg!"] {
                        if line.contains(disallowed) {
                            if err_count == 0 {
                                eprintln!("\nDetected nonfunctional print statements:\n");
                            }
                            eprintln!("{printable_path}:{line_number}: {line}");
                            err_count += 1;
                        }
                    }
                }
            }
        }
        if err_count > 0 {
            eprintln!();
            anyhow::bail!(
                "Found {err_count} disallowed print statement(s).\n\
                These will not be printed from SpacetimeDB modules.\n\
                If you need to print something, use the `log` crate\n\
                and the `log::info!` macro instead."
            );
        }
    } else {
        println!(
            "Warning: Skipping checks for nonfunctional print statements.\n\
            If you have used builtin macros for printing, such as println!,\n\
            your logs will not show up."
        );
    }

    let mut args = if let Some(features) = features {
        vec![format!("--features={}", features.to_string_lossy())]
    } else {
        vec![]

View on GitHub (pinned to 524b4487d9)

When it happens

Trigger: Thrown at crates/cli/src/tasks/rust.rs:68 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/fff625699e60f330. Report an issue: GitHub.