{"record":{"id":"1e5ff860676ab6fc","repo":"clockworklabs/SpacetimeDB","slug":"project-path-does-not-exist","errorCode":null,"errorMessage":"Project path does not exist: {}","messagePattern":"Project path does not exist: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":663,"sourceCode":"        let dotnet_version = if command_config.is_from_cli(\"dotnet_version\") {\n            command_config.get_one::<u8>(\"dotnet_version\")?\n        } else {\n            let dotnet_version = command_config.get_one::<String>(\"dotnet_version\")?;\n            parse_optional_dotnet_version(dotnet_version.as_deref())?\n        };\n\n        // If the user didn't specify an identity and we didn't specify an anonymous identity, then\n        // we want to use the default identity\n        // TODO(jdetter): We should maybe have some sort of user prompt here for them to be able to\n        //  easily create a new identity with an email\n        let auth_header = get_auth_header(config, anon_identity, server, !yes.skip_login).await?;\n\n        let (name_or_identity, parent) = validate_name_and_parent(name_or_identity, parent)?;\n\n        if let Some(path_to_project) = path_to_project.as_ref()\n            && !path_to_project.exists()\n        {\n            return Err(anyhow::anyhow!(\n                \"Project path does not exist: {}\",\n                path_to_project.display()\n            ));\n        }\n\n        // Decide program file path and read program.\n        // Optionally build the program.\n        let (path_to_program, host_type) = if let Some(path) = wasm_file {\n            println!(\"(WASM) Skipping build. Instead we are publishing {}\", path.display());\n            (path.clone(), \"Wasm\")\n        } else if let Some(path) = js_file {\n            println!(\"(JS) Skipping build. Instead we are publishing {}\", path.display());\n            (path.clone(), \"Js\")\n        } else {\n            build::exec_with_argstring(\n                path_to_project\n                    .as_ref()\n                    .expect(\"path_to_project must exist when publishing from source\"),","sourceCodeStart":645,"sourceCodeEnd":681,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/cli/src/subcommands/publish.rs#L645-L681","documentation":"Early validation in `spacetime publish`: after resolving auth and the database name/parent, the CLI checks that the project directory to build from actually exists on disk and bails with 'Project path does not exist: <path>' before attempting any build or upload. The path comes from the publish command's project-path argument (or its config resolution), and the check runs only when a path was supplied.","triggerScenarios":"Running `spacetime publish --project-path <dir>` (or a spacetime.json/config that resolves to one) where <dir> does not exist — wrong relative path judged against the cwd, a deleted/moved directory, or a typo. Publishing with --bin-path/--js-path (wasm/js file) skips this check.","commonSituations":"Running publish from a different cwd than where the path was written for (relative '../server' resolves differently); directory renamed after a refactor while scripts kept the old path; CI checkouts that skip the server module; trailing whitespace or quotes around the path in shell scripts.","solutions":["Verify and fix the path: `ls <path>` from the same cwd you invoke publish from","Use an absolute path in CI scripts to remove cwd dependence","If the project truly moved, update --project-path or the spacetime.json entry that supplies it"],"exampleFix":"# before (run from repo root, wrong relative path)\nspacetime publish --project-path server-module\n# after\nspacetime publish --project-path ./crates/server-module   # verified with ls","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nproj=\"${1:?usage: publish.sh <project-dir>}\"\nproj=\"${proj%/}\"   # drop trailing slash/whitespace sources of mismatch\n[ -d \"$proj\" ] || { echo \"project dir not found: $proj (from $(pwd))\" >&2; exit 2; }\nspacetime publish --project-path \"$proj\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for --project-path in CI so cwd changes can't break resolution","Assert the directory exists in wrapper scripts before invoking publish","After renaming/moving a module directory, update every script and spacetime.json reference to it"],"tags":["cli","publish","project-path","filesystem","validation"],"backgroundTag":"file-not-found","analyzedSha":"eddf9f5014579a50d4b67630e28b6e15cad9c4af","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}