{"record":{"id":"33815a83654439f1","repo":"clockworklabs/SpacetimeDB","slug":"the-features-option-is-only-supported-for-rust-m","errorCode":null,"errorMessage":"The --features option is only supported for Rust modules.","messagePattern":"The --features option is only supported for Rust modules\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/tasks/mod.rs","lineNumber":23,"sourceCode":"use self::cpp::build_cpp;\nuse self::csharp::build_csharp;\nuse self::javascript::build_javascript;\nuse self::rust::build_rust;\n\nuse duct::cmd;\n\n// TODO: Replace the returned `&'static str` with a copy of `HostType` from core.\npub fn build(\n    project_path: &Path,\n    lint_dir: Option<&Path>,\n    build_debug: bool,\n    features: Option<&std::ffi::OsString>,\n    native_aot: bool,\n    dotnet_version: Option<u8>,\n) -> anyhow::Result<(PathBuf, &'static str)> {\n    let lang = util::detect_module_language(project_path)?;\n    if features.is_some() && lang != ModuleLanguage::Rust {\n        anyhow::bail!(\"The --features option is only supported for Rust modules.\");\n    }\n    let output_path = match lang {\n        ModuleLanguage::Rust => build_rust(project_path, features, lint_dir, build_debug),\n        ModuleLanguage::Csharp => build_csharp(project_path, build_debug, native_aot, dotnet_version),\n        ModuleLanguage::Javascript => build_javascript(project_path, build_debug),\n        ModuleLanguage::Cpp => build_cpp(project_path, build_debug),\n    }?;\n\n    if lang == ModuleLanguage::Javascript {\n        Ok((output_path, \"Js\"))\n    } else if build_debug {\n        Ok((output_path, \"Wasm\"))\n    } else {\n        // for release builds, optimize wasm modules with wasm-opt\n        let mut wasm_path = output_path;\n        eprintln!(\"Optimising module with wasm-opt...\");\n        let wasm_path_opt = wasm_path.with_extension(\"opt.wasm\");\n        match cmd!(\"wasm-opt\", \"-all\", \"-g\", \"-O2\", &wasm_path, \"-o\", &wasm_path_opt).run() {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/tasks/mod.rs#L5-L41","documentation":"Error \"The --features option is only supported for Rust modules.\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/src/tasks/mod.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}