Closed OmniacDev closed 3 days ago
Oh and I should add that if I comment out the line in App.tsx where I use the titlebar, then the entire rest of the app runs fine with no errors
This is because your import shadow the global window. You should avoid this and rename your import to:
import { appWindow } from "@tauri-apps/api/window"
or import * as tauriWindow from "@tauri-apps/api/window"
if you absolutely want to use import all, but this a bad practice because it make it harder for bundler to treeshake your code
Describe the bug
When using my TitleBar element, it throws this error:
Here is the code for the element:
I've tried everything, but nothing seems to fix it. It's always this element, and the error randomly jumps around the file (eg. if I put an empty line at 1, then the import at line 2, then the error appears on line 23). The only solution I've found is to just disable the plugin entirely.
Reproduction
https://github.com/OmniacDEV/Amethyst-Launcher_TR
Steps to reproduce
run
npm run tauri dev
, and then open DevTools with Ctrl + Shift + I, and you can see the error.System Info
Used Package Manager
npm
Logs
No response
Validations