clockworklabs/SpacetimeDB · warning

Cannot continue without a module path.

Error message

Cannot continue without a module path.

What it means

During `spacetime dev`, when no module path could be determined (no `module-path` in config and no `./spacetimedb` directory), the CLI interactively asks `Would you like to provide --module-path now?`. Answering 'no' makes the command bail because a module source path is mandatory for the dev loop — there is nothing to watch, build, or publish without it.

Source

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

                    lc.loaded_files
                        .iter()
                        .map(|f| strip_verbatim_prefix(f).display().to_string())
                        .collect::<Vec<_>>()
                        .join(", ")
                })
                .unwrap_or_else(|| "spacetime.json".to_string());
            println!("{} {}", "Found config files:".yellow().bold(), files.dimmed());
            println!(
                "{}",
                "Could not determine module path because no `module-path` was found and `./spacetimedb` does not exist."
                    .yellow()
            );
            let should_provide = Confirm::new()
                .with_prompt("Would you like to provide --module-path now?")
                .default(true)
                .interact()?;
            if !should_provide {
                anyhow::bail!("Cannot continue without a module path.");
            }

            let config_dir = loaded_config
                .as_ref()
                .map(|lc| lc.config_dir.clone())
                .ok_or_else(|| anyhow::anyhow!("Missing loaded config directory"))?;

            let provided_module_path: String = Input::with_theme(&ColorfulTheme::default())
                .with_prompt("Module path")
                .default("spacetimedb".to_string())
                .validate_with({
                    let config_dir = config_dir.clone();
                    move |input: &String| -> Result<(), String> {
                        let candidate = PathBuf::from(input);
                        let resolved = if candidate.is_absolute() {
                            candidate
                        } else {
                            config_dir.join(&candidate)

View on GitHub (pinned to 524b4487d9)

Solutions

  1. Re-run and answer `y` at the prompt, accepting or editing the default `spacetimedb` path
  2. Create the module directory so it is auto-detected: `mkdir spacetimedb` and add module sources there
  3. Add `module-path` to `spacetime.json` (or pass `--module-path spacetimedb`) so the prompt never appears
  4. If the module lives elsewhere, pass its path: `spacetime dev --module-path path/to/module`

Example fix

# before
Would you like to provide --module-path now? > n
# after
spacetime dev --module-path crates/server  # or answer y at the prompt
Defensive patterns

Strategy: validation

Validate before calling

# Ensure the module dir exists so the prompt is skipped
[ -d ./spacetimedb ] || { echo "create ./spacetimedb or set module-path"; exit 1; }
spacetime dev

Prevention

When it happens

Trigger: Running `spacetime dev` in a directory that has some config files but no `module-path` field and no `./spacetimedb` folder, then answering `n` at the `--module-path` prompt.

Common situations: Starting dev mode in a client-only repo; a `spacetime.json` edited to remove `module-path`; reorganizing the module into a differently named folder without updating config.

Related errors


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