This error appeared in webview's console.
Why is this error appearing and how to solve it?
In my real app, I want to the button be shown if and only if the new window is not opened.
I managed to do that with onCloseRequested, but met this issue.
minimal reproduction:
pnpm create tauri-app- add
"window": { "all": true }inallowlistintauriintauri.conf.json - add below in
App.tsx
import { WebviewWindow } from "@tauri-apps/api/window";
<input
type="button"
onClick={() => {
const wv = new WebviewWindow("a", { url: "../index.html" });
wv.onCloseRequested(() => {});
}}
value="new"
/>
pnpm tauri dev- click the button above, a window will appear
- close the new window, the error message appears in the main window's console
pnpm tauri info
[✔] Environment
- OS: EndeavourOS Rolling Release X64
✔ webkit2gtk-4.0: 2.42.4
✔ rsvg2: 2.57.1
✔ rustc: 1.75.0 (82e1608df 2023-12-21)
✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
✔ rustup: 1.26.0 (2023-11-14)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 21.6.0
- pnpm: 8.14.1
- npm: 10.3.0
[-] Packages
- tauri [RUST]: 1.5.4
- tauri-build [RUST]: 1.5.1
- wry [RUST]: 0.24.7
- tao [RUST]: 0.16.6
- @tauri-apps/api [NPM]: 1.5.3
- @tauri-apps/cli [NPM]: 1.5.9
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- framework: React
- bundler: Vite