tauri-apps / vue-cli-plugin-tauri

Turn your Vue SPA into a lightweight cross-platform desktop app
https://tauri.studio
MIT License
372 stars 23 forks source link

Unable to run in dev mode #36

Open sakthig opened 3 years ago

sakthig commented 3 years ago

Unable to run app in dev mode

When I run yarn tauri:serve on a freshly created vue app it shows blank screen. Instead if I do yarn tauri:build the app loads fine.

To Reproduce

  1. Create app using https://github.com/tauri-apps/vue-cli-plugin-tauri
  2. Run 'yarn tauri:serve'

Expected behavior

Should load vue app, instead of white screen.

Screenshots

Screenshot 2021-06-25 at 12 32 55 PM

Platform and Versions (required):

Operating System - Mac OS, version 10.15.7 X64

Node.js environment
  Node.js - 15.4.0
  @tauri-apps/cli - 1.0.0-beta.3
  @tauri-apps/api - Not installed

Global packages
  npm - 7.0.15
  yarn - 1.22.4

Rust environment
  rustc - 1.51.0
  cargo - 1.51.0

App directory structure
/node_modules
/public
/src-tauri
/src

App
  tauri.rs - 1.0.0-beta.2
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../webpack_dist
  devPath - http://localhost:8081
  framework - Vue.js (Vue CLI)
  bundler - Webpack

Stack Trace

2021-06-25 12:41:10.420 app[23948:7631938] NSWindow warning: adding an unknown subview: <WKInspectorWKWebView: 0x7f9463f25d10>. Break on NSLog to debug. 2021-06-25 12:41:10.432 app[23948:7631938] Call stack:

        0   AppKit                              0x00007fff2d2d392b -[NSThemeFrame addSubview:] + 112
        1   AppKit                              0x00007fff2d2d3634 -[NSView addSubview:positioned:relativeTo:] + 203
        2   AppKit                              0x00007fff2d2d34f0 -[NSThemeFrame addSubview:positioned:relativeTo:] + 46
        3   WebKit                              0x00007fff40f59bb0 _ZN6WebKit17WebInspectorProxy14platformAttachEv + 384
        4   WebKit                              0x00007fff411e2f08 _ZN6WebKit17WebInspectorProxy4openEv + 96
        5   WebKit                              0x00007fff41420252 _ZN6WebKit17WebInspectorProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 1710
        6   WebKit                              0x00007fff40f99684 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE + 114
        7   WebKit                              0x00007fff4125f232 _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 28
        8   WebKit                              0x00007fff40f8592b _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 209
        9   WebKit                              0x00007fff40f8528f _ZN3IPC10Connection24dispatchIncomingMessagesEv + 475
        10  JavaScriptCore                      0x00007fff347cbe67 _ZN3WTF7RunLoop11performWorkEv + 551
        11  JavaScriptCore                      0x00007fff347cc01a _ZN3WTF7RunLoop11performWorkEPv + 26
        12  CoreFoundation                      0x00007fff30036d52 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        13  CoreFoundation                      0x00007fff30036cf1 __CFRunLoopDoSource0 + 103
        14  CoreFoundation                      0x00007fff30036b0b __CFRunLoopDoSources0 + 209
        15  CoreFoundation                      0x00007fff3003583a __CFRunLoopRun + 927
        16  CoreFoundation                      0x00007fff30034e3e CFRunLoopRunSpecific + 462
        17  HIToolbox                           0x00007fff2ec61abd RunCurrentEventLoopInMode + 292
        18  HIToolbox                           0x00007fff2ec617d5 ReceiveNextEventCommon + 584
        19  HIToolbox                           0x00007fff2ec61579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
        20  AppKit                              0x00007fff2d2a7039 _DPSNextEvent + 883
        21  AppKit                              0x00007fff2d2a5880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
        22  AppKit                              0x00007fff2d29758e -[NSApplication run] + 658
        23  app                                 0x000000010068bed6 _ZN60_$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$6invoke17h90f7000944708029E + 70
        24  app                                 0x000000010068b5f2 _ZN4objc7message8platform15send_unverified17h6c182ccca3ae5a4dE + 98
        25  app                                 0x0000000100124d06 _ZN3tao13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return17h2b8a2136333bd5a1E + 1350
        26  app                                 0x0000000100125147 _ZN3tao13platform_impl8platform10event_loop18EventLoop$LT$T$GT$3run17h59c31582501e2069E + 71
        27  app                                 0x0000000100083426 _ZN3tao10event_loop18EventLoop$LT$T$GT$3run17he9cbf933459d6180E + 118
        28  app                                 0x00000001001c26f9 _ZN65_$LT$tauri_runtime_wry..Wry$u20$as$u20$tauri_runtime..Runtime$GT$3run17h929bd474465a1a84E + 553
        29  app                                 0x000000010030bfe5 _ZN5tauri3app40Builder$LT$E$C$L$C$MID$C$TID$C$A$C$R$GT$3run17hc5012ac43791a91fE + 565
        30  app                                 0x000000010025ae05 _ZN3app4main17h782a36e83d19f4e0E + 3509
        31  app                                 0x000000010005ab2e _ZN4core3ops8function6FnOnce9call_once17he5477bf929002075E + 14
        32  app                                 0x0000000100097b41 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hc42a9d3ecc02c961E + 17
        33  app                                 0x00000001001a8724 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hc4b1f83edddd9cf9E + 20
        34  app                                 0x0000000100b73774 _ZN3std2rt19lang_start_internal17h86f505dc7de50d93E + 644
        35  app                                 0x00000001001a8701 _ZN3std2rt10lang_start17h5ca7d4f5891f38ccE + 65
        36  app                                 0x000000010025b172 main + 34
        37  libdyld.dylib                       0x00007fff6a0d6cc9 start + 1
        38  ???                                 0x0000000000000001 0x0 + 1
josiahdowdy commented 2 years ago

In case anyone gets the blank white screen, what fixed the issue for me is going into file "tauri.conf.json" and changing the line: "devPath": "http://localhost:5000" to the same port my terminal was running to my web browser, which in my case was 8080.