{"record":{"id":"d37ca5376c5e3fbc","repo":"tw93/Pake","slug":"url-type-must-be-web-or-local-got-other","errorCode":null,"errorMessage":"url_type must be 'web' or 'local', got '{other}'","messagePattern":"url_type must be 'web' or 'local', got '(.+?)'","errorType":"validation","errorClass":"tauri::Error","httpStatus":null,"severity":"critical","filePath":"src-tauri/src/app/window.rs","lineNumber":358,"sourceCode":"            \"pake.json must define at least one window configuration\",\n        ))\n    })?;\n    let url = match window_config.url_type.as_str() {\n        \"web\" => {\n            let parsed = window_config.url.parse().map_err(|err| {\n                tauri::Error::Io(std::io::Error::new(\n                    std::io::ErrorKind::InvalidInput,\n                    format!(\n                        \"Invalid 'web' url '{}' in pake.json: {err}\",\n                        window_config.url\n                    ),\n                ))\n            })?;\n            WebviewUrl::App(parsed)\n        }\n        \"local\" => WebviewUrl::App(PathBuf::from(&window_config.url)),\n        other => {\n            return Err(tauri::Error::Io(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                format!(\"url_type must be 'web' or 'local', got '{other}'\"),\n            )));\n        }\n    };\n\n    build_window(\n        app,\n        config,\n        tauri_config,\n        WindowBuildOptions {\n            label,\n            url,\n            visible: false,\n            new_window_features: None,\n        },\n    )\n}","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/tw93/Pake/blob/c8fe8a3f1a115428e3555c06b3de9b7458aa0d54/src-tauri/src/app/window.rs#L340-L376","documentation":"build_window_with_label matches windows[0].url_type against only \"web\" and \"local\"; any other string returns an InvalidInput io error wrapped in tauri::Error. The url_type field is an enum-like contract of the pake.json schema.","triggerScenarios":"pake.json windows[0].url_type is set to a typo or unsupported value such as 'remote', 'file', 'Web', or '' and any window build (set_window, open_additional_window) is attempted.","commonSituations":"Hand-editing pake.json with wrong casing; a config generator emitting a new url_type not supported by this Pake version; copy-paste from another Tauri project's schema.","solutions":["Change url_type in pake.json to exactly 'web' or 'local' (lowercase).","If the URL is remote use 'web'; for packaged local content use 'local' with a relative path in url.","Rebuild via the pake CLI so the validated config is regenerated."],"exampleFix":"// before (pake.json)\n{ \"url\": \"https://example.com\", \"url_type\": \"remote\" }\n// after\n{ \"url\": \"https://example.com\", \"url_type\": \"web\" }","handlingStrategy":"validation","validationCode":"if (!['web', 'local'].includes(cfg.url_type)) throw new Error(`url_type must be 'web' or 'local', got '${cfg.url_type}'`);","typeGuard":"const hasValidUrlType = (c) => c?.url_type === 'web' || c?.url_type === 'local';","tryCatchPattern":"match build_window_with_label(...) { Err(e) if e.to_string().contains(\"url_type must be\") => eprintln!(\"fix url_type in pake.json: {e}\"), Err(e) => return Err(e), Ok(w) => w }","preventionTips":["Keep url_type exactly lowercase 'web' or 'local' per schema/pake.schema.json (an enum)","Run the schema-based config test before shipping config changes","Never invent new url_type values without extending the Rust match and schema together"],"tags":["configuration","enum","tauri"],"backgroundTag":"invalid-enum-value","analyzedSha":"c8fe8a3f1a115428e3555c06b3de9b7458aa0d54","analyzedAt":"2026-09-20T12:02:36.283Z","contentChangedAt":"2026-09-20T12:02:36.283Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}