The problem of using tauri in centos #2498
Answered
by
hanxiaohuivc
hanxiaohuivc
asked this question in
Q&A
-
Hi everyone. I deployed tauri in centos7 and reported the following problems when using rust commands: SyntaxError: Unexpected token'{'. import call expects exactly one argument. My js code is as follows, these codes can run normally under windows: <script> import {invoke} from'@tauri-apps/api/tauri' const TAURI=window.__TAURI__; const invoke = window.__TAURI__.invoke function jswebapi() { $.ajax({ url: "https://jsonplaceholder.typicode.com/posts/1", type: "get", success: function (data) { console.log(data); let textId = $("#jswebapitext"); textId.val(JSON.stringify(data)); } }); } </script>How to modify in centos? Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
hanxiaohuivc
Aug 23, 2021
Replies: 1 comment 2 replies
-
I found the reason by myself. In Linux, you should use ‘const invoke = window.TAURI_INVOKE’ instead of ‘const invoke = window.TAURI.invoke’. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
hanxiaohuivc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found the reason by myself. In Linux, you should use ‘const invoke = window.TAURI_INVOKE’ instead of ‘const invoke = window.TAURI.invoke’.