tauri-apps / tauri-apps/plugins-workspace

plugin-barcode-scanner iOS crash: "io error: No route to host (os error 65)"

Open
#3,328 4 comments 0 reactions 0 assignees View on GitHub
platform: ios plugin: barcode-scanner type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug

The barcode plugin is working fine in my Sveltekit2 app on Android since months.
Never an issue.

All dependencies of any kind are the latest.

Trying now in iOS it crashes "badly", with this error:
iOS I'm trying on is an iphone SE3, but the same happend on other users iphones too.

`io error: No route to host (os error 65)`

That error is catched by some "global error cateher" when I do not try to "catch" the error in the Svelte component that runs it.
But, when I run the code down there, the app just crashes and no error is reported and the "signal" inside the catch are *never* called.
It just vanishes the whole app.

To be more clear:
1. the app goes in scan mode as soon as the onMount calls the "scan()" function.
2. if I focus on the QR code --> crashes badly
3. in a previous version of the code I had a cancel button that was calling the plugin "cancel()" function. That was also crashing the whole app badly in the same way, with the same error.

This is the code. I always get to `scanner_permission_granted` but I never see `scanner_scan_completed` - but that's ok. I also never see the signal sent in the "catch" and not even the one in "finally". The app crashes in Rust code and that is it.

```js
onMount(async () => {
setTransparency('add')
const granted = await ensurePermissions()
if (!granted) {
error = {message: 'Camera permission denied'}
signal('scanner_permission_refused')
setTimeout(onCancel, DELAY_BEFORE_CANCEL)
return
}
signal('scanner_permission_granted')
try {
const result = await scan({
windowed: true,
formats: [Format.QRCode],
})
signal('scanner_scan_completed')
if (!result.content)
throw new Error('Scanner returned empty result')
const {content} = result
signal('scanner_scan_succesfull', {content})
onResult(content)
} catch (error) {
// console.error(error)
signal('scanner_scan_failed', {})
const message = getErrorMessage(error)
signal('scanner_scan_error', {message})
} finally {
signal('scanner_scan_finished', {})
}
})
```

Bundle config

```json5
bundle: {
iOS: {
infoPlist: './Info.ios.plist',
bundleVersion: '22',
},
},
```

and full Info.ios.plist

```xml

ITSAppUsesNonExemptEncryption

NSCameraUsageDescription
Nucube uses the camera to scan QR codes for importing your music library from the desktop app.
NSAppTransportSecurity

NSAllowsLocalNetworking


NSLocalNetworkUsageDescription
Nucube needs local network access to discover and stream from DLNA media servers on your network.
NSBonjourServices

_http._tcp

```

### Reproduction

_No response_

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✔] Environment
- OS: Ubuntu 25.10.0 x86_64 (X64) (ubuntu on wayland)
✔ webkit2gtk-4.1: 2.50.4
✔ rsvg2: 2.60.0
✔ rustc: 1.90.0 (1159e78c4 2025-09-14)
✔ cargo: 1.90.0 (840b83a10 2025-07-30)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 24.14.0
- yarn: 4.13.0
- npm: 11.9.0
- bun: 1.2.22

[-] Packages
- tauri 🦀: 2.10.2
- tauri-build 🦀: 2.5.5
- wry 🦀: 0.54.2
- tao 🦀: 0.34.5
- @tauri-apps/api ⱼₛ: 2.10.1
- @tauri-apps/cli ⱼₛ: 2.10.0

[-] Plugins
- tauri-plugin-http 🦀: 2.5.7
- @tauri-apps/plugin-http ⱼₛ: 2.5.7
- tauri-plugin-upload 🦀: 2.4.0
- @tauri-apps/plugin-upload ⱼₛ: 2.4.0
- tauri-plugin-os 🦀: 2.3.2
- @tauri-apps/plugin-os ⱼₛ: 2.3.2
- tauri-plugin-shell 🦀: 2.3.5
- @tauri-apps/plugin-shell ⱼₛ: 2.3.5
- tauri-plugin-fs 🦀: 2.4.5
- @tauri-apps/plugin-fs ⱼₛ: 2.4.5
- tauri-plugin-dialog 🦀: 2.6.0
- @tauri-apps/plugin-dialog ⱼₛ: 2.6.0
- tauri-plugin-single-instance 🦀: 2.4.0
- @tauri-apps/plugin-single-instance ⱼₛ: not installed!
- tauri-plugin-updater 🦀: 2.10.0
- @tauri-apps/plugin-updater ⱼₛ: not installed!
- tauri-plugin-barcode-scanner 🦀: 2.4.4
- @tauri-apps/plugin-barcode-scanner ⱼₛ: 2.4.4
- tauri-plugin-notification 🦀: 2.3.3
- @tauri-apps/plugin-notification ⱼₛ: 2.3.3
- tauri-plugin-opener 🦀: 2.5.3
- @tauri-apps/plugin-opener ⱼₛ: 2.5.3
- tauri-plugin-log 🦀: 2.8.0
- @tauri-apps/plugin-log ⱼₛ: 2.8.0
- tauri-plugin-deep-link 🦀: 2.4.7
- @tauri-apps/plugin-deep-link ⱼₛ: 2.4.7

[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../build
- devUrl: http://localhost:2222/
- framework: Svelte
- bundler: Vite
```

### Stack trace

```text
`io error: No route to host (os error 65)`
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.