Skip to content
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

Signed MacOS Tauri Build - Unhandled Promise Rejection: shell error: failed to open: Scoped shell IO error: Launcher failed with ExitStatus(unix_wait_status(256)) #5893

Open
AdlerJS opened this issue Dec 22, 2022 · 5 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@AdlerJS
Copy link

AdlerJS commented Dec 22, 2022

Describe the bug

I have a signed MacOS Tauri build for distribution and when I try and use shell.open to open a fileDir on the computer it results in the following error being thrown Unhandled Promise Rejection: shell error: failed to open: Scoped shell IO error: Launcher failed with ExitStatus(unix_wait_status(256))

Note: The code works in local develop and in unsigned builds this only occurs in signed macOS builds.

Code Example:

const filePath = await dialog.save();
const fileDir = dirname(filePath);
shell.open(fileDir); // Note - fileDir is something like Users/Dan/Desktop

Tauri Config (shell):

 "shell": {
        "all": true,
        "execute": true,
        "sidecar": true,
        "open": "^"
      }

Reproduction

1.) Create a signed mac os build
2.) Use shell.open to open a local file directory

Expected behavior

Local file directory should open on signed macOS builds

Platform and versions

Environment
  › OS: Mac OS 12.6.0 X64
  › Node.js: 14.16.1
  › npm: 6.14.12
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.63.0
  › cargo: 1.63.0
  › Rust toolchain: stable-x86_64-apple-darwin

Packages
  › @tauri-apps/cli [NPM]: 1.2.0 (outdated, latest: 1.2.2)
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.0,
  › tauri-build [RUST]: 1.2.0,
  › tao [RUST]: 0.15.3,
  › wry [RUST]: 0.22.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http:https://localhost:4003/
  › framework: React

App directory structure
  ├─ _templates
  ├─ node_modules
  ├─ gsuite
  ├─ ios
  ├─ android-old
  ├─ public
  ├─ android
  ├─ src-tauri
  ├─ build
  ├─ .git
  ├─ .idea
  └─ src

Stack trace

No response

Additional context

No response

@AdlerJS AdlerJS added status: needs triage This issue needs to triage, applied to new issues type: bug labels Dec 22, 2022
@glen0125
Copy link

glen0125 commented Jan 4, 2023

same problem

@glen0125
Copy link

glen0125 commented Jan 4, 2023

I solved the problem by using the original rust open and calling it using invoke, maybe you need to pass in a specific app using open::with to get it to work.

@Zertz
Copy link

Zertz commented Jan 9, 2023

Tangentially related, did you follow any specific instructions to publish a signed build on the Mac App Store?

@Hacksore
Copy link
Contributor

So I have some code that does something like this to create the dir.

// crate the config dir if it's not there
try {
  await createDir(await appConfigDir(), {
    recursive: true,
  });
} catch (err: unknown) {
  // noop
}

Seems that it makes a folder but it's beyond cursed...

$ file /Users/hacksore/Library/Application\ Support/com.overlayed.app
/Users/hacksore/Library/Application Support/com.overlayed.app: directory

$ ls /Users/hacksore/Library/Application\ Support/com.overlayed.app                                                                                      
config.json

image

When I go to call shell.open on the directory I get:

Unhandled Promise Rejection: shell error: failed to open: Scoped shell IO error: Launcher failed with ExitStatus(unix_wait_status(256))

@Hacksore
Copy link
Contributor

Ok well im dumb, you can't call your app namespace ending in .app cause it will think it's a macOS app 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
Status: 📬Proposal
Development

No branches or pull requests

5 participants