Unhandled Promise Rejection: TypeError: window.__TAURI_IPC__ is not a function.
Describe the bug
This is the default code generated and cannot be run.
Reproduction
No response
Expected behavior
No response
Full tauri info output
[✔] Environment
- OS: Mac OS 10.14.6 X64
✔ Xcode Command Line Tools: installed
✔ rustc: 1.76.0 (07dca489a 2024-02-04)
✔ cargo: 1.76.0 (c84b36747 2024-01-18)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-apple-darwin (default)
- node: 18.9.1
- pnpm: 8.15.3
- yarn: 1.22.10
- npm: 8.19.1
[-] Packages
- tauri [RUST]: 1.6.0
- tauri-build [RUST]: 1.5.1
- wry [RUST]: 0.24.7
- tao [RUST]: 0.16.7
- @tauri-apps/api [NPM]: 1.5.3
- @tauri-apps/cli [NPM]: 1.5.10
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:1420/
- framework: Vue.js
- bundler: Vite
Stack trace
No response
Additional context
No response
Any update for this problem?
I meet the same problem
Can you 2 also post the output of the tauri info command please?
I am having the same problem.
Only __TAURI_INTERNALS__ is available in the main window and the @tauri-apps/api invoke() method is not available.
% bun run tauri info
$ tauri info
[✔] Environment
- OS: Mac OS 14.2.1 X64
✔ Xcode Command Line Tools: installed
✔ rustc: 1.76.0 (07dca489a 2024-02-04)
✔ cargo: 1.76.0 (c84b36747 2024-01-18)
✔ rustup: 1.26.0 (2023-04-05)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 21.4.0
- npm: 10.2.4
- bun: 1.0.18
[-] Packages
- tauri [RUST]: 2.0.0-beta.10
- tauri-build [RUST]: 2.0.0-beta.8
- wry [RUST]: 0.37.0
- tao [RUST]: 0.26.1
- @tauri-apps/api [NPM]: 1.5.3
- @tauri-apps/cli [NPM]: 2.0.0-beta.8
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React (Next.js)
- bundler: Vite
@8beeeaaat Your @tauri-apps/api package is outdated. If you update it to v2 beta it should work.
I still can't reproduce this. I even dug out my macos catalina VM to almost match OP's tauri info output but it just works.
Anyone still seeing this, please upload the app that has this issue to github, and describe the exact steps you took that lead to this error.
Also, even though it doesn't seem apply to OP's screenshot, Tauri's ipc only works in actual tauri windows, so if you open your frontend in your normal browser then this error is to be expected...
I still can't reproduce this. I even dug out my macos catalina VM to almost match OP's tauri info output but it just works.
Anyone still seeing this, please upload the app that has this issue to github, and describe the exact steps you took that lead to this error.
Also, even though it doesn't seem apply to OP's screenshot, Tauri's ipc only works in actual tauri windows, so if you open your frontend in your normal browser then this error is to be expected...
I have resolved my problem!
Uncaught (in promise) TypeError: window.TAURI_IPC is not a function ,这个问题解决了吗?
I ran into this because I set all my Tauri packages to install the latest tag, but the Tauri @tauri-apps/api package doesn't use latest to mean the 2.0.0 version, and instead requires next to install the 2.0.0 version.
I will close this issue since some people resolved their issues and the others didn't react to my messages. If you're still facing this issue, feel free to keep commenting (ideally with those instructions in mind https://github.com/tauri-apps/tauri/issues/8961#issuecomment-1994607248 ) or open a new issue.
I encountered the same problem and have not solved it. If someone has a solution, could you provide the solution?
Are you trying to open the app in a browser?
https://stackoverflow.com/a/76083271/487878