Skip to content

[bug] window.documentPictureInPicture.requestWindow throws "no window" error #14411

@bra1n

Description

@bra1n

Describe the bug

It seems like a recent Tauri update broke the documentPictureInPicture interface for Tauri apps on Windows 10. With older Tauri versions, I was able to open PiP windows just fine (and it still works on Edge itself), but the latest Tauri version for some reason broke this support.

Reproduction

  1. create a Tauri app with npm create tauri-app@latest (vanilla JS frontend)
  2. add this code to the greet() example function:
await window.documentPictureInPicture.requestWindow({
  width: 600,
  height: 400,
});
  1. click on the "Greet" button

Expected behavior

A new sub-window of the current Tauri window should have opened, like this:
Image
This works if I open the Tauri dev server in a local Edge instance.

Full tauri info output

> [email protected] tauri
> tauri info


[✔] Environment
    - OS: Windows 10.0.19045 x86_64 (X64)
    ✔ WebView2: 141.0.3537.99
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.86.0 (05f9846f8 2025-03-31)
    ✔ cargo: 1.86.0 (adf9b6ad1 2025-02-28)
    ✔ rustup: 1.28.1 (f9edccde0 2025-03-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 25.1.0
    - npm: 11.6.2

[-] Packages
    - tauri 🦀: 2.9.2
    - tauri-build 🦀: 2.5.1
    - wry 🦀: 0.53.5
    - tao 🦀: 0.34.5
    - @tauri-apps/api  ⱼₛ: not installed!
    - @tauri-apps/cli  ⱼₛ: 2.9.2

[-] Plugins
    - tauri-plugin-opener 🦀: 2.5.2
    - @tauri-apps/plugin-opener  ⱼₛ: not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../src

Stack trace

main.js:7 
 Uncaught (in promise) InvalidStateError: Failed to execute 'requestWindow' on 'DocumentPictureInPicture': Internal error: no window
    at greet (main.js:7:41)
    at HTMLFormElement.<anonymous> (main.js:20:5)
greet	@	main.js:7
(anonymous)	@	main.js:20

Additional context

This worked on previous Tauri versions without issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions