{"record":{"id":"338712db1b354def","repo":"tauri-apps/tauri","slug":"not-implemented-webview","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri/src/manager/webview.rs","lineNumber":499,"sourceCode":"            // this will never fail\n            .unwrap()\n        } else {\n          url.into_owned()\n        }\n      }\n      WebviewUrl::External(url) => {\n        let config_url = app_manager.get_app_url(pending.webview_attributes.use_https_scheme);\n        let is_app_url = config_url.make_relative(url).is_some();\n        let mut url = url.clone();\n        if is_app_url && PROXY_DEV_SERVER && is_local_network_url(&url) {\n          Url::parse(\"tauri://localhost\").unwrap()\n        } else {\n          url\n        }\n      }\n\n      WebviewUrl::CustomProtocol(url) => url.clone(),\n      _ => unimplemented!(),\n    };\n\n    #[cfg(not(feature = \"webview-data-url\"))]\n    if url.scheme() == \"data\" {\n      return Err(crate::Error::InvalidWebviewUrl(\n        \"data URLs are not supported without the `webview-data-url` feature.\",\n      ));\n    }\n\n    #[cfg(feature = \"webview-data-url\")]\n    if let Some(csp) = app_manager.csp() {\n      if url.scheme() == \"data\" {\n        if let Ok(data_url) = data_url::DataUrl::process(url.as_str()) {\n          let (body, _) = data_url.decode_to_vec().unwrap();\n          let html = String::from_utf8_lossy(&body).into_owned();\n          // naive way to check if it's an html\n          if html.contains('<') && html.contains('>') {\n            let document = tauri_utils::html2::parse_doc(html);","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri/src/manager/webview.rs#L481-L517","documentation":"prepare_webview resolves the URL to load from WebviewUrl. External and App/CustomProtocol URLs are handled explicitly; other WebviewUrl variants hit `unimplemented!()`. A webview prepared with a URL kind the manager doesn't recognize panics during webview creation.","triggerScenarios":"Creating a webview (WebviewWindowBuilder / WebviewBuilder) whose WebviewUrl is a variant other than External or CustomProtocol — e.g. reaching an internal App variant handling path, or constructing WebviewUrl programmatically with an unexpected case.","commonSituations":"Building webviews dynamically in a plugin and constructing WebviewUrl manually; library version changes where a new WebviewUrl variant exists but the manager wasn't updated; misusing internal APIs from a custom runtime.","solutions":["Only construct WebviewUrl::External or WebviewUrl::CustomProtocol for webview creation","Use WebviewUrl::parse (via from_str) instead of hand-building the enum so variants stay valid","Upgrade tauri if a new variant was introduced by a dependency mismatch"],"exampleFix":"// before\nlet url = WebviewUrl::App(PathBuf::from(\"/index.html\")); // internal misuse\n// after\nlet url = WebviewUrl::External(\"tauri://localhost/index.html\".parse()?);","handlingStrategy":"validation","validationCode":"let url = match &url_input {\n  WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_) => Ok(url_input.clone()),\n  _ => Err(anyhow::anyhow!(\"unsupported WebviewUrl kind\")),\n}?;","typeGuard":"fn is_supported_url(u: &WebviewUrl) -> bool {\n  matches!(u, WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_))\n}","tryCatchPattern":null,"preventionTips":["Build WebviewUrl via WebviewUrl::parse/External/CustomProtocol only","Avoid reaching into WebviewUrl internal variants from plugins","Upgrade tauri components together when the enum gains variants"],"tags":["webview","unimplemented","url","rust"],"backgroundTag":"method-not-implemented","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}