When i try to use the JS api like this for example:
import { exit } from '@tauri-apps/api/process';
import { getName } from '@tauri-apps/api/app';
console.log(getName);
async function exitA()
{
await exit(0);
}
i get
[Error] SyntaxError: Unexpected token '{'. import call expects one or two arguments.
(anonymous function) (main.mjs:1)
I've ran cargo add tauri-api(idk if i should do it but i did it), ran npm install --save-dev @tauri-apps/api
enabled the api in tauri.conf.json like
"tauri": {
"allowlist": {
"all": true
},
(I use cargo for building and running the app)