agmmnn / tauri-controls

🚥 Native-looking window controls for Tauri 2. React, Solid, Vue, Svelte+Tailwind.
https://npmjs.com/package/tauri-controls
MIT License
581 stars 21 forks source link

WindowTitleBar os buttons events do not work as tauri-plugin-window has been put back into Tauri core since 2.0.0-alpha.16 #19

Closed ThibaultDct closed 5 months ago

ThibaultDct commented 7 months ago

Hello,

I am currently using tauri-controls on my project. I just upgraded Tauri to 1.5.2. But as you may know, tauri-plugin-window isn't relevant anymore as it has been put back into Tauri core since 2.0.0-alpha.16. My question is, how to make tauri-controls work since theses changes ?

Thank you

ntillier commented 7 months ago

Hi, I think I am facing the same issue on Windows (I use Tauri + Nextjs). I have these two errors: TypeError: window.__TAURI_INVOKE__ is not a function and TypeError: Cannot read properties of undefined (reading '__currentWindow'), and it seems to be related to this.

ThibaultDct commented 7 months ago

Hi, I think I am facing the same issue on Windows (I use Tauri + Nextjs). I have these two errors: TypeError: window.__TAURI_INVOKE__ is not a function and TypeError: Cannot read properties of undefined (reading '__currentWindow'), and it seems to be related to this.

I first created my project with NextJS and encountered this issue. I think that one of your function involving the window API is executed server-side, which don't have a window as your client does. The error I encounter in my React + Tauri project is that WindowTitleBar component is made for using OS and Window plugins from Tauri, which aren't relevant anymore as they have been integrated back to Tauri's core. So the errors I have are theses ones as WindowTitleBar is trying to access Tauri plugins :

Uncaught (in promise) plugin os not found Uncaught (in promise) plugin window not found Uncaught (in promise) plugin event not found Uncaught (in promise) plugin app not found

anver commented 6 months ago

doesn't work on latest tauri alpha release

Unhandled Promise Rejection: TypeError: window.__TAURI_INVOKE__ is not a function. (In 'window.__TAURI_INVOKE__("plugin:window|close", {
      label: this.label
    })', 'window.__TAURI_INVOKE__' is undefined)

Unhandled Promise Rejection: TypeError: window.__TAURI_INVOKE__ is not a function. (In 'window.__TAURI_INVOKE__("plugin:window|toggle_maximize", {
      label: this.label
    })', 'window.__TAURI_INVOKE__' is undefined)

Unhandled Promise Rejection: TypeError: window.__TAURI_INVOKE__ is not a function. (In 'window.__TAURI_INVOKE__("plugin:window|minimize", {
      label: this.label
    })', 'window.__TAURI_INVOKE__' is undefined)
agmmnn commented 6 months ago

At the moment I'm a little busy, but I'll update the repo soon to match the latest Tauri release. 🙏