Repository: tauri
Issue: [bug] Yew app crash on macOS arm64
Labels: type: bug,platform: macOS,status: needs triage

### Describe the bug

I can run Tauri locally for a few tech stacks with no issue. I tried React/JavaScript and Leptos and they all work out of the gate. If I try to use the Yew version I get a crash.

<img width="1112" alt="SCR-20240830-shon" src="https://github.com/user-attachments/assets/5ab003bb-f8b3-44b5-8c8b-f5c77f0ece70">


### Reproduction

```
> $cargo install tauri-cli@^2.0.0-rc
> $ pnpm create tauri-app --rc
> $ pnpm create tauri-app --rc
✔ Project name · heycast
✔ Identifier · com.heycast.app
✔ Choose which language to use for your frontend · Rust - (cargo)
✔ Choose your UI template · Yew - (https://yew.rs/)

Template created! To get started run:
  cd heycast
  cargo tauri android init
  cargo tauri ios init

For Desktop development, run:
  cargo tauri dev

For Android development, run:
  cargo tauri android dev

For iOS development, run:
  cargo tauri ios dev

> $ cargo tauri -V
tauri-cli 2.0.0-rc.8

> $ cargo tauri dev
2024-08-31T00:08:31.234664Z  INFO 🚀 Starting trunk 0.20.2
2024-08-31T00:08:31.235040Z  INFO ⏫ Found an update of trunk: 0.20.2 -> 0.20.3
2024-08-31T00:08:31.236523Z  INFO 📦 starting build
    Warn Waiting for your frontend dev server to start on http://localhost:1420/...
...
```


### Expected behavior

Basic Yew Tauri app window is displayed.

### Full `tauri info` output

```text
[✔] Environment
    - OS: Mac OS 14.4.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 22.4.1
    - pnpm: 9.4.0
    - yarn: 1.22.21
    - npm: 10.8.1
    - bun: 1.1.20

[-] Packages
    - tauri 🦀: 2.0.0-rc.8
    - tauri-build 🦀: 2.0.0-rc.7
    - wry 🦀: 0.42.0
    - tao 🦀: 0.29.1
    - tauri-cli 🦀: 2.0.0-rc.8

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
```
```


### Stack trace

```text
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               heycast [27469]
Path:                  /Users/USER/*/heycast
Identifier:            heycast
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        cargo-tauri [27325]
User ID:               501

Date/Time:             2024-08-30 21:03:41.0824 -0300
OS Version:            macOS 14.4.1 (23E224)
Report Version:        12
Anonymous UUID:        95E3865B-6F4D-B84E-1BA5-6E22F31A919E

Sleep/Wake UUID:       81F5FEEC-0300-4540-A467-F884A16835C7

Time Awake Since Boot: 1100000 seconds
Time Since Wake:       354284 seconds

System Integrity Protection: enabled

Notes:
Extracting libpas PGM metadata failed.

Crashed Thread:        0  main  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       UNKNOWN_0x101 at 0x000000000bad4007
Exception Codes:       0x0000000000000101, 0x000000000bad4007

Termination Reason:    Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process:   exc handler [27469]

VM Region Info: 0xbad4007 is not in any region.  Bytes before following region: 4146348025
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      102d18000-10429c000    [ 21.5M] r-x/r-x SM=COW  /Users/USER/*/heycast

Error Formulating Crash Report:
Extracting libpas PGM metadata failed.

Thread 0 Crashed:: main Dispatch queue: com.apple.main-thread
0   ???                           	         0xbad4007 ???
1   ImageIO                       	       0x19bca90b8 IIOReadPlugin::callInitialize() + 584
2   ImageIO                       	       0x19bca8dbc IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) + 128
3   ImageIO                       	       0x19bca675c IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) + 816
4   ImageIO                       	       0x19bca6030 IIOImageSource::getPropertiesAtIndexInternal(unsigned long, IIODictionary*) + 72
5   ImageIO                       	       0x19bca5f4c IIOImageSource::copyPropertiesAtIndex(unsigned long, IIODictionary*) + 24
6   ImageIO                       	       0x19bca5df0 CGImageSourceCopyPropertiesAtIndex + 332
7   AppKit                        	       0x194b5abf8 ImageSourceOptionsForCGImageSource_index_ + 64
8   AppKit                        	       0x194b5aa78 +[NSBitmapImageRep _imagesWithData:hfsFileType:extension:zone:expandImageContentNow:includeAllReps:] + 428
9   AppKit                        	       0x194c721ec +[NSBitmapImageRep imageRepsWithData:] + 68
10  AppKit                        	       0x194c71abc -[NSImage initWithData:] + 76
11  heycast                       	       0x1037e20a0 _$LT$$LP$A$C$$RP$$u20$as$u20$objc..message..MessageArguments$GT$::invoke::h642393208245ecf8 + 112
12  heycast                       	       0x1037e9e58 objc::message::platform::send_unverified::_$u7b$$u7b$closure$u7d$$u7d$::ha6b00eb6dc604991 + 64
13  heycast                       	       0x1037e5d98 objc_exception::try::_$u7b$$u7b$closure$u7d$$u7d$::h06d29c39dd259369 + 44
14  heycast                       	       0x1037e497c objc_exception::try_no_ret::try_objc_execute_closure::h1edbe88ed1511a57 + 84
15  heycast                       	       0x1037f3820 RustObjCExceptionTryCatch + 36
16  heycast                       	       0x1037e3904 objc_exception::try_no_ret::h0cedd85773836f12 + 160
17  heycast                       	       0x1037e5170 objc_exception::try::h2c12f23923cf3a29 + 72
18  heycast                       	       0x1037eaeb0 objc::exception::try::hef6f47604fe281a9 + 12
19  heycast                       	       0x1037e8ec8 objc::message::platform::send_unverified::hff66ef939bf0cd85 + 152
20  heycast                       	       0x1037ccde0 _$LT$$BP$mut$u20$objc..runtime..Object$u20$as$u20$cocoa..appkit..NSImage$GT$::initWithData_::hc0e2ea75912bebc9 + 304
21  heycast                       	       0x10329e52c tauri::app::on_event_loop_event::h9dc43a8a7691afe0 + 2260
22  heycast                       	       0x10329913c tauri::app::App$LT$R$GT$::run::_$u7b$$u7b$closure$u7d$$u7d$::h1a9075821abe897d + 716
23  heycast                       	       0x103024ab0 tauri_runtime_wry::handle_event_loop::h4e3cdd234b196e92 + 1064
24  heycast                       	       0x103028790 _$LT$tauri_runtime_wry..Wry$LT$T$GT$$u20$as$u20$tauri_runtime..Runtime$LT$T$GT$$GT$::run::_$u7b$$u7b$closure$u7d$$u7d$::ha19c8d2e572f545b + 812
25  heycast                       	       0x103457f60 _$LT$tao..platform_impl..platform..app_state..EventLoopHandler$LT$T$GT$$u20$as$u20$tao..platform_impl..platform..app_state..EventHandler$GT$::handle_nonuser_event::_$u7b$$u7b$closure$u7d$$u7d$::h5993903e620f01b3 + 652
26  heycast                       	       0x103458370 tao::platform_impl::platform::app_state::EventLoopHandler$LT$T$GT$::with_callback::hfc43e193d0d9bb85 + 416
27  heycast                       	       0x103457cc8 _$LT$tao..platform_impl..platform..app_state..EventLoopHandler$LT$T$GT$$u20$as$u20$tao..platform_impl..platform..app_state..EventHandler$GT$::handle_nonuser_event::hcaa4acc0266ef78c + 64
28  heycast                       	       0x10366df54 tao::platform_impl::platform::app_state::Handler::handle_nonuser_event::h3ecaf91d511fc83b + 868
29  heycast                       	       0x10366ea4c tao::platform_impl::platform::app_state::AppState::launched::h939fbb8bc9862ebc + 456
30  heycast                       	       0x1036b6148 tao::platform_impl::platform::app_delegate::did_finish_launching::hf349c921e52efe2d + 80
31  CoreFoundation                	       0x19120ab1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
32  CoreFoundation                	       0x19129edb8 ___CFXRegistrationPost_block_invoke + 88
33  CoreFoundation                	       0x19129ed00 _CFXRegistrationPost + 440
34  CoreFoundation                	       0x1911d9648 _CFXNotificationPost + 768
35  Foundation                    	       0x1922f5464 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
36  AppKit                        	       0x194a7437c -[NSApplication _postDidFinishNotification] + 284
37  AppKit                        	       0x194a7412c -[NSApplication _sendFinishLaunchingNotification] + 172
38  AppKit                        	       0x194a72674 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 504
39  AppKit                        	       0x194a72270 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 492
40  Foundation                    	       0x19231d914 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 316
41  Foundation                    	       0x19231d708 _NSAppleEventManagerGenericHandler + 80
42  AE                            	       0x19822e9c4 0x198223000 + 47556
43  AE                            	       0x19822e2ec 0x198223000 + 45804
44  AE                            	       0x1982278a8 aeProcessAppleEvent + 488
45  HIToolbox                     	       0x19b9bee90 AEProcessAppleEvent + 68
46  AppKit                        	       0x194a6cc7c _DPSNextEvent + 1440
47  AppKit                        	       0x19525edec -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700
48  AppKit                        	       0x194a5fcb8 -[NSApplication run] + 476
49  heycast                       	       0x1037eb1a4 _$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$::invoke::h02787475dd222354 + 72
50  heycast                       	       0x1037ea4b0 objc::message::platform::send_unverified::_$u7b$$u7b$closure$u7d$$u7d$::hd907dadf8d1e20d7 + 60
51  heycast                       	       0x1037e6480 objc_exception::try::_$u7b$$u7b$closure$u7d$$u7d$::h800ccf6a7766e113 + 44
52  heycast                       	       0x1037e4f3c objc_exception::try_no_ret::try_objc_execute_closure::he69d457538489a2e + 76
53  heycast                       	       0x1037f3820 RustObjCExceptionTryCatch + 36
54  heycast                       	       0x1037e3edc objc_exception::try_no_ret::h6a82b812d258b81f + 144
55  heycast                       	       0x1037e50ac objc_exception::try::h152ffc32e423669e + 72
56  heycast                       	       0x1037ead88 objc::exception::try::h4ba74bc4b99e6bc6 + 12
57  heycast                       	       0x1037e8bb8 objc::message::platform::send_unverified::he7dee9b5e469d0a7 + 136
58  heycast                       	       0x103442dbc tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run_return::hf414d157b9fea638 + 1052
59  heycast                       	       0x103443a14 tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run::ha29daad39ae6015e + 20
60  heycast                       	       0x1031d8f18 tao::event_loop::EventLoop$LT$T$GT$::run::h6421474a517c4fd8 + 60
61  heycast                       	       0x103028334 _$LT$tauri_runtime_wry..Wry$LT$T$GT$$u20$as$u20$tauri_runtime..Runtime$LT$T$GT$$GT$::run::h83540f765adf2d0f + 460
62  heycast                       	       0x103298e14 tauri::app::App$LT$R$GT$::run::h8a5d48c22889a2d2 + 372
63  heycast                       	       0x103299730 tauri::app::Builder$LT$R$GT$::run::hb952369b7433d295 + 104
64  heycast                       	       0x103227a38 heycast_lib::run::he90b2fe8a5ec40aa + 652
65  heycast                       	       0x102d1c524 heycast::main::hfa4ac8e4e2e94c0e + 12 (main.rs:5)
66  heycast                       	       0x102d1c604 core::ops::function::FnOnce::call_once::h7e8152ac2a25b446 + 20 (function.rs:250)
67  heycast                       	       0x102d1c570 std::sys_common::backtrace::__rust_begin_short_backtrace::hd0c643f86163099e + 24 (backtrace.rs:155)
68  heycast                       	       0x102d1c6a8 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hca57a0c5e7da6495 + 28 (rt.rs:159)
69  heycast                       	       0x103b2a494 std::rt::lang_start_internal::h27a134f18d582a1e + 640
70  heycast                       	       0x102d1c674 std::rt::lang_start::h136c9ee7e14788aa + 84 (rt.rs:158)
71  heycast                       	       0x102d1c550 main + 36
72  dyld                          	       0x190dae0e0 start + 2360

Thread 1:
0   libsystem_pthread.dylib       	       0x191131d20 start_wqthread + 0
<...>

Model: Mac15,9, BootROM 10151.101.3, proc 16:12:4 processors, 48 GB, SMC 
Graphics: Apple M3 Max, Apple M3 Max, Built-In
Display: Odyssey G8, 6720 x 3780, Main, MirrorOff, Online
Display: MB16QHG, 1600 x 2560, MirrorOff, Online
Display: Yam Display, 2732 x 2048, MirrorOff, Online
Memory Module: LPDDR5, Micron
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x4388), wl0: Jan 13 2024 06:19:30 version 23.30.42.0.41.51.132 FWID 01-5ba6bbe8
AirPort: 
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Thunderbolt Ethernet Slot 0, Ethernet, en8
Network Service: Wi-Fi, AirPort, en0
Network Service: iPad, Ethernet, en11
Network Service: Tailscale, VPN (io.tailscale.ipn.macos), utun4
PCI Card: ethernet, Ethernet Controller, Thunderbolt@3,0,0
USB Device: USB31Bus
USB Device: USB3.0 Hub
USB Device: TS4 USB3.2 Gen2 HUB
USB Device: TS4 USB3.2 Gen2 HUB
USB Device: USB3.2 Hub
USB Device: TS4 USB3.2 Gen2 HUB
USB Device: iPad
USB Device: TS4 USB2.0 Hub
USB Device: TPS DMC Family
USB Device: TS4 USB2.0 HUB
USB Device: composite_device
USB Device: MagSafe Charging Case
USB Device: TS4 USB2.0 HUB
USB Device: USB Receiver
USB Device: USB2.1 Hub
USB Device: TS4 USB2.0 HUB
USB Device: Creative Pebble Pro
USB Device: USB31Bus
USB Device: USB31Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Device: TS4, CalDigit, Inc., 1, 39.1
```


### Additional context

_No response_