Are you running Tauri as a desktop app ? In order to invoke backend commands from the frontend, Tauri must be started with npm run tauri dev while in the root of your project.
npm run tauri dev