tauri-apps/tauri · error

not implemented

Error message

not implemented

What it means

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.

Solutions

  1. Only construct WebviewUrl::External or WebviewUrl::CustomProtocol for webview creation
  2. Use WebviewUrl::parse (via from_str) instead of hand-building the enum so variants stay valid
  3. Upgrade tauri if a new variant was introduced by a dependency mismatch

Example fix

// before
let url = WebviewUrl::App(PathBuf::from("/index.html")); // internal misuse
// after
let url = WebviewUrl::External("tauri://localhost/index.html".parse()?);
Defensive patterns

Strategy: validation

Validate before calling

let url = match &url_input {
  WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_) => Ok(url_input.clone()),
  _ => Err(anyhow::anyhow!("unsupported WebviewUrl kind")),
}?;

Type guard

fn is_supported_url(u: &WebviewUrl) -> bool {
  matches!(u, WebviewUrl::External(_) | WebviewUrl::CustomProtocol(_))
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/338712db1b354def. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri/src/manager/webview.rs:499

            // this will never fail
            .unwrap()
        } else {
          url.into_owned()
        }
      }
      WebviewUrl::External(url) => {
        let config_url = app_manager.get_app_url(pending.webview_attributes.use_https_scheme);
        let is_app_url = config_url.make_relative(url).is_some();
        let mut url = url.clone();
        if is_app_url && PROXY_DEV_SERVER && is_local_network_url(&url) {
          Url::parse("tauri://localhost").unwrap()
        } else {
          url
        }
      }

      WebviewUrl::CustomProtocol(url) => url.clone(),
      _ => unimplemented!(),
    };

    #[cfg(not(feature = "webview-data-url"))]
    if url.scheme() == "data" {
      return Err(crate::Error::InvalidWebviewUrl(
        "data URLs are not supported without the `webview-data-url` feature.",
      ));
    }

    #[cfg(feature = "webview-data-url")]
    if let Some(csp) = app_manager.csp() {
      if url.scheme() == "data" {
        if let Ok(data_url) = data_url::DataUrl::process(url.as_str()) {
          let (body, _) = data_url.decode_to_vec().unwrap();
          let html = String::from_utf8_lossy(&body).into_owned();
          // naive way to check if it's an html
          if html.contains('<') && html.contains('>') {
            let document = tauri_utils::html2::parse_doc(html);

View on GitHub (pinned to 460ec35447)