{"record":{"id":"5963c8c9462f711b","repo":"clockworklabs/SpacetimeDB","slug":"module-bindings-path-must-be-a-relative-path","errorCode":null,"errorMessage":"Module bindings path must be a relative path","messagePattern":"Module bindings path must be a relative path","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/dev.rs","lineNumber":181,"sourceCode":"    // If you don't specify a server, we default to your default server\n    // If you don't have one of those, we default to \"maincloud\"\n    let server_from_cli = args.get_one::<String>(\"server\").map(|s| s.as_str());\n\n    let default_server_name = config.default_server_name().map(|s| s.to_string());\n\n    let mut resolved_server = server_from_cli\n        .or(default_server_name.as_deref())\n        .ok_or_else(|| anyhow::anyhow!(\"Server not specified and no default server configured.\"))?;\n\n    let cwd = std::env::current_dir()?;\n    let mut project_dir = if project_path.is_absolute() {\n        project_path.clone()\n    } else {\n        cwd.join(project_path)\n    };\n\n    if module_bindings_path.is_absolute() {\n        anyhow::bail!(\"Module bindings path must be a relative path\");\n    }\n    let mut module_bindings_dir = project_dir.join(module_bindings_path);\n\n    let mut spacetimedb_dir = match module_path_from_cli {\n        Some(path) => {\n            if path.is_absolute() {\n                path.clone()\n            } else {\n                std::env::current_dir()?.join(path)\n            }\n        }\n        None => project_dir.join(\"spacetimedb\"),\n    };\n\n    let no_config = args.get_flag(\"no_config\");\n    let skip_publish = args.get_flag(\"skip_publish\");\n    let skip_generate = args.get_flag(\"skip_generate\");\n    let native_aot_from_cli = args.get_flag(\"native_aot\");","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/3653d2ed498fddbd83b7062aa6bf8970e18635ec/crates/cli/src/subcommands/dev.rs#L163-L199","documentation":"`spacetime dev` requires --module-bindings-path to be a relative path because it is joined onto the project directory to form the destination. An absolute path is rejected up front rather than being silently mis-joined or overriding the project anchor.","triggerScenarios":"Passing an absolute module bindings path on the CLI (`spacetime dev --module-bindings-path /home/me/proj/bindings`) or configuring one absolutely, then running dev/generate.","commonSituations":"CI scripts building paths from $PWD; shell completion inserting absolute paths; editors or codegen tools emitting absolute output dirs.","solutions":["Pass a path relative to the project directory (e.g. `bindings` or `../shared-bindings`)","If you need a fixed location, anchor it via --project-path and express the bindings path relatively"],"exampleFix":"# before\nspacetime dev --module-bindings-path /home/me/proj/bindings\n\n# after\nspacetime dev --module-bindings-path bindings","handlingStrategy":"validation","validationCode":"// reject absolute bindings paths before running dev\nif module_bindings_path.is_absolute() {\n    anyhow::bail!(\"--module-bindings-path must be relative to the project dir\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express bindings paths relative to the project root in scripts and configs","Anchor absolute locations with --project-path, not the bindings flag"],"tags":["cli","path","filesystem","dev","validation"],"backgroundTag":"invalid-path-argument","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"}