wails: [Mac] Can not show the UI when exec 'wails dev'

Description

Can not show the UI when exec ‘wails dev’ (just an empty window), but web ui works. Also, the app created by ‘wails build’ works too.

To Reproduce

wails dev on my Mac(10.15 catalina)

Expected behaviour

the UI when exec ‘wails dev’ works

Screenshots

image

Attempted Fixes

No response

System Details

❯ wails doctor
Wails CLI v2.0.0-beta.38


Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:		MacOS
Version: 	10.15.7
ID:		199506
Go Version:	go1.17.6
Platform:	darwin
Architecture:	amd64

Wails
------
Version: 	v2.0.0-beta.38

Dependency			Package Name	Status		Version
----------			------------	------		-------
xcode command line tools 	N/A		Installed	2373
npm 				N/A		Installed	8.0.0
*upx 				N/A		Available
*nsis 				N/A		Available

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : Available at https://nsis.sourceforge.io/Download

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (6 by maintainers)

Most upvoted comments

@stffabi @leaanthony

<key>NSAppTransportSecurity</key>
        <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
            <key>NSExceptionDomains</key>
            <dict>
                <key>localhost</key>
                <dict>
                    <key>NSExceptionAllowsInsecureHTTPLoads</key>
                    <true/>
                    <key>NSIncludesSubdomains</key>
                    <true/>
                    <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                    <false/>
                </dict>
           </dict>
      </dict>

I add these config in build/darwin/Info.plist, and retry rm -rf build/bin && wails dev, it works now haha

Awesome! Thanks for letting us know. This was a great suggestion. Here’s a virtual beer 🍻 👍

Tried it out, and works perfectly! Thanks for fixing this, sorry about the delay in testing it.

I can confirm that the minimal fix above works with Vue3 and Vite. Thanks for the fix!

@stffabi your settings works~~ 👍 Thank you very much for your patient guidance 😃

@cxt90730 awesome that it works now for you 👍

We would like to document this in a troubleshooting guide #1508 . It would be great to find the minimal settings needed to get it working, especially Apple has a “AllowLocalNetworking” flag. Would it be possible for you to give the following settings in your Info.plist a try, that would be awesome?

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>