-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tauri process immediate exit #7731
Comments
Reproducible on Ubuntu 22.04 x86-64. The selected JS frameworks don't change the output, as expected. |
Okay, so I managed to create a minimal script to reproduce this issue: // Run this script in a fresh Tauri app folder on a GNU system, created with `bun --bun x create-tauri-app@latest`
// if you're on OSX, replace the nativeBiding with the darwin one from the @tauri-apps folder
let nativeBinding;
try {
nativeBinding = require("./node_modules/@tauri-apps/cli-linux-x64-gnu/cli.linux-x64-gnu.node");
} catch (e) {
console.log(e);
}
if (!nativeBinding) {
throw new Error(`Failed to load native binding`);
}
const { run, logError } = nativeBinding;
const runPromise = async (args, binName) => {
return new Promise((resolve, reject) => {
run(args, binName, (res) => {
if (res instanceof Error) {
reject(res);
} else {
resolve(res);
}
});
});
};
runPromise(["dev"], "bun").catch((err) => {
logError(err.message);
console.log(JSON.stringify(err, null, 2));
process.exit(1);
}); The script above runs as expected using Node 20.5.1, but fails with Bun 1.0.18. Adding a I believe the If anyone wants to use Tauri with Bun before this gets fixed, change line 54 of Edit: still happening with Bun 1.0.30. |
I see the same thing on macos. Adding the await will fix bun, but break node with: ➜ npm run tauri dev
> tauri-node@0.0.0 tauri
> tauri dev
/Users/admin/repos/bun-kitchensink/tauri-app/node_modules/@tauri-apps/cli/tauri.js:54
await cli.run(args, binName).catch((err) => {
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49
Node.js v20.13.0 |
@9Morello , does it work for you now? My issue/repro is resolved since both of these commands run:
1.1.17+bb66bba1b |
Running the app in the browser yields an error when trying to submit a "Greet" in the app: @tauri-apps_api_tauri.js?v=2580b4ea:30 Uncaught (in promise) TypeError: window.__TAURI_IPC__ is not a function
at @tauri-apps_api_taur…js?v=2580b4ea:30:12
at new Promise (<anonymous>)
at invoke (@tauri-apps_api_taur…js?v=2580b4ea:21:10)
at greet (main.ts:9:36)
at HTMLFormElement.<anonymous> (main.ts:20:5) But when it opens in it's own window, it'll work as expected |
What version of Bun is running?
1.0.18+36c316a24
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
bun --bun x create-tauri-app@latest
(selected i.e. typescript / solidjs)cd tauri-app
bun --bun run tauri dev
What is the expected behavior?
the expected result can be seen by running
bun run tauri dev
(without the --bun flag)What do you see instead?
immediate exit, same for
tauri build
Additional information
No response
The text was updated successfully, but these errors were encountered: