{"record":{"id":"560520c17a921792","repo":"clockworklabs/SpacetimeDB","slug":"module-path-project-path-and-module-b","errorCode":null,"errorMessage":"`--module-path`, `--project-path`, and `--module-bindings-path` cannot be used when `spacetime.json` contains generate targets. Remove these flags or remove generate targets from config.","messagePattern":"`--module-path`, `--project-path`, and `--module-bindings-path` cannot be used when `spacetime\\.json` contains generate targets\\. Remove these flags or remove generate targets from config\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/dev.rs","lineNumber":339,"sourceCode":"        .map(|g| !g.is_empty())\n        .unwrap_or(false);\n\n    let module_path_from_cli_flag = args.value_source(\"module-path\") == Some(ValueSource::CommandLine);\n    let project_path_from_cli_flag = args.value_source(\"project-path\") == Some(ValueSource::CommandLine);\n    let module_bindings_path_from_cli_flag =\n        args.value_source(\"module-bindings-path\") == Some(ValueSource::CommandLine);\n\n    if has_publish_targets_in_config && module_path_from_cli_flag {\n        anyhow::bail!(\n            \"`--module-path` cannot be used when `spacetime.json` contains publish targets. \\\n             Remove `--module-path` or run without publish targets in config.\"\n        );\n    }\n\n    if has_generate_targets_in_config\n        && (module_path_from_cli_flag || project_path_from_cli_flag || module_bindings_path_from_cli_flag)\n    {\n        anyhow::bail!(\n            \"`--module-path`, `--project-path`, and `--module-bindings-path` cannot be used when \\\n             `spacetime.json` contains generate targets. Remove these flags or remove generate targets from config.\"\n        );\n    }\n\n    // Fetch the database name if it was passed through a CLI arg\n    let database_name_from_cli: Option<String> = args\n        .get_one::<String>(\"database\")\n        .or_else(|| args.get_one::<String>(\"database-flag\"))\n        .map(|name| {\n            if args.get_one::<String>(\"database-flag\").is_some() {\n                println!(\n                    \"{} {}\",\n                    \"Warning:\".yellow().bold(),\n                    \"--database flag is deprecated. Use positional argument instead: spacetime dev <database>\".dimmed()\n                );\n            }\n            name.clone()","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/3653d2ed498fddbd83b7062aa6bf8970e18635ec/crates/cli/src/subcommands/dev.rs#L321-L357","documentation":"The counterpart guard for generate targets: when spacetime.json declares generate entries, none of --module-path, --project-path, or --module-bindings-path may come from the CLI, because those paths are owned by the per-entry configuration and a CLI value would conflict with it.","triggerScenarios":"spacetime.json has a non-empty generate array and any of --module-path, --project-path, or --module-bindings-path is supplied on the command line.","commonSituations":"Reusing an old dev command line after adding generate entries to spacetime.json; wrapper scripts that always pass the three path flags.","solutions":["Remove the three path flags and configure paths per generate entry in spacetime.json","Remove the generate targets from spacetime.json if you want CLI-driven paths"],"exampleFix":"# before\nspacetime dev --module-bindings-path bindings\n# spacetime.json has \"generate\": [ ... ]\n\n# after\nspacetime dev    # paths come from the generate entries","handlingStrategy":"validation","validationCode":"// with generate targets configured, none of the three path flags may come from the CLI\nlet has_generate_targets = !spacetime_json.generate.as_ref().map_or(false, Vec::is_empty);\nif has_generate_targets {\n    for f in [\"--module-path\", \"--project-path\", \"--module-bindings-path\"] {\n        assert!(!cli_has_flag(f), \"{f} conflicts with generate targets in spacetime.json\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Own path configuration in spacetime.json once generate entries exist","Remove hardcoded path flags from CI and aliases during migration"],"tags":["cli","dev","generate","spacetime-json","paths"],"backgroundTag":"conflicting-cli-config-options","analyzedSha":"3653d2ed498fddbd83b7062aa6bf8970e18635ec","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}