tauri-apps/tauri

[bug]

Closed this issue · 1 comments

Describe the bug

made some buttons following the tauri window customization guide in nextjs but when i clicked them it threw an error.

error.mp4

Reproduction

Use appWindow functions in a tauri app with nextjs.

Expected behavior

The

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 x86_64 (X64)
    ✔ WebView2: 129.0.2792.52
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 22.8.0
    - pnpm: 9.10.0
    - npm: 10.8.2
    - bun: 1.1.27

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.2
    - tauri-cli 🦀: 2.0.0-rc.16
    - @tauri-apps/api : 1.6.0
    - @tauri-apps/cli : 2.0.0-rc.16

[-] Plugins
    - tauri-plugin-log 🦀: 2.0.0-rc.2
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../out
    - devUrl: http://localhost:3000/
    - framework: React (Next.js)
    - bundler: Webpack

Stack trace

None

Additional context

I've seen the error in svelte but i don't know what to do in nextjs

Your @tauri-apps/api package is outdated. Once you update it to v2 you'll see that appWindow was removed in favor of getCurrent() and frameworks like nextjs were the reason for this change.