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

Cant not load localhost:34115 in app use wails dev [bate.35] #1358

Closed
daodao97 opened this issue Apr 28, 2022 · 8 comments
Closed

Cant not load localhost:34115 in app use wails dev [bate.35] #1358

daodao97 opened this issue Apr 28, 2022 · 8 comments
Labels
Bug Something isn't working

Comments

@daodao97
Copy link
Contributor

Description

wails dev get error in webview console

Failed to load resource: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

To Reproduce

wails init -n myproject
cd myproject
wails dev

Expected behaviour

load localhost:34115

Screenshots

image

Attempted Fixes

No response

System Details

Wails CLI v2.0.0-beta.35


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

System
------
OS:		MacOS
Version: 	11.6
ID:		199506
Go Version:	go1.17.2
Platform:	darwin
Architecture:	amd64

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

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

* - Optional Dependency

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

Additional context

No response

@daodao97 daodao97 added the Bug Something isn't working label Apr 28, 2022
@stffabi
Copy link
Collaborator

stffabi commented Apr 28, 2022

Thanks for reporting this issue. I have a couple of questions, which hopefully allows to narrow down the problem.

  • Are you able to open http://localhost:34115 in Safari?
  • Could you please provide a screenshot of the DevTools network tab, after triggering a reload?
  • Could you also provide a screenshot of the Response Headers of the requests from the DevTools network tab?

Thanks for your help.

@stffabi
Copy link
Collaborator

stffabi commented Apr 28, 2022

Seems like we probably need to make changes to the info.plist, Fine-tune your App Transport Security settings

Interestingly I have never seen that on MacOS 12 during the development of the frontend devserver feature. @leaanthony did you encounter that?

According to this App Transport Security should allow access to local network resources on iOS 10 and macOS 10.12 and later. Maybe they had a regression in 11.6 ?

@daodao97
Copy link
Contributor Author

daodao97 commented Apr 29, 2022

<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>

after add this config in build/darwin/Info.plist, and retry rm -rf build/bin && wails dev, it working.

@leaanthony
Copy link
Member

It would be good to add this to the TroubleShooting Guide

@daodao97
Copy link
Contributor Author

daodao97 commented Apr 29, 2022

but after wails build && open build/bin/myproject.app/Contents/MacOS/myproject , app is crash

error in terminal is

/Users/sandao/work/ott/wails/myproject/build/bin/myproject.app/Contents/MacOS/myproject ; exit;
unexpected fault address 0xb01dfacedebac1e
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x4068089]

goroutine 1 [running, locked to thread]:
runtime.throw({0x42d8408, 0x0})
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/panic.go:1198 +0x71 fp=0xc0001a5a90 sp=0xc0001a5a60 pc=0x4037211
runtime.sigpanic()
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/signal_unix.go:742 +0x2f6 fp=0xc0001a5ae0 sp=0xc0001a5a90 pc=0x404ca56
runtime.memmove()
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/memmove_amd64.s:410 +0x489 fp=0xc0001a5ae8 sp=0xc0001a5ae0 pc=0x4068089
runtime.gobytes(0x4287060, 0x696c202c)
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/string.go:311 +0x73 fp=0xc0001a5b38 sp=0xc0001a5ae8 pc=0x40523f3
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin._Cfunc_GoBytes(...)
	_cgo_gotypes.go:266
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.processURLRequest.func1(0x42bf5a0, 0x696c202c)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:400 +0x45 fp=0xc0001a5b70 sp=0xc0001a5b38 pc=0x42523a5
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.processURLRequest(0x51168e0, 0x47531a1, 0x0, 0xc0001a5c40, 0x4066aa2, 0x4066aa2)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:400 +0x45 fp=0xc0001a5be0 sp=0xc0001a5b70 pc=0x42521c5
_cgoexp_d6fc8ef76700_processURLRequest(0xc0001a5c58)
	_cgo_gotypes.go:711 +0x33 fp=0xc0001a5c20 sp=0xc0001a5be0 pc=0x4255733
runtime.cgocallbackg1(0x4255700, 0xc0001a5dd8, 0x0)
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/cgocall.go:306 +0x29a fp=0xc0001a5cf0 sp=0xc0001a5c20 pc=0x40080da
runtime.cgocallbackg(0xc0000001a0, 0x300000002, 0xc0000001a0)
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/cgocall.go:232 +0x109 fp=0xc0001a5d80 sp=0xc0001a5cf0 pc=0x4007da9
runtime.cgocallbackg(0x4255700, 0x7ffeefbfb008, 0x0)
	<autogenerated>:1 +0x2f fp=0xc0001a5da8 sp=0xc0001a5d80 pc=0x4068ecf
runtime.cgocallback(0x4007c25, 0x425d490, 0xc0001a5e38)
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/asm_amd64.s:915 +0xb4 fp=0xc0001a5dd0 sp=0xc0001a5da8 pc=0x4066bd4
runtime.systemstack_switch()
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/asm_amd64.s:350 fp=0xc0001a5dd8 sp=0xc0001a5dd0 pc=0x4064b80
runtime.cgocall(0x425d490, 0xc0001a5e38)
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/cgocall.go:166 +0x85 fp=0xc0001a5e10 sp=0xc0001a5dd8 pc=0x4007c25
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin._Cfunc_Run(0x51168e0, 0x5036cf0)
	_cgo_gotypes.go:414 +0x45 fp=0xc0001a5e38 sp=0xc0001a5e10 pc=0x424d065
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Window).Run.func1(0xc00001b0e0, 0xe)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/window.go:124 +0x4c fp=0xc0001a5e78 sp=0xc0001a5e38 pc=0x4253eac
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Window).Run(0xc000128870, {0xc00001b0e0, 0x4369040})
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/window.go:124 +0x3b fp=0xc0001a5ea8 sp=0xc0001a5e78 pc=0x4253d9b
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).Run(0xc000194780, {0x43717a0, 0xc00019c840})
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:152 +0x14d fp=0xc0001a5ef0 sp=0xc0001a5ea8 pc=0x4250bcd
github.com/wailsapp/wails/v2/internal/appng.(*App).Run(0xc000074410)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/appng/app_production.go:38 +0x31 fp=0xc0001a5f28 sp=0xc0001a5ef0 pc=0x425bcf1
github.com/wailsapp/wails/v2.Run(0x4007c51)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/wails.go:24 +0x33 fp=0xc0001a5f40 sp=0xc0001a5f28 pc=0x425c4b3
main.main()
	/Users/sandao/work/ott/wails/myproject/main.go:17 +0x106 fp=0xc0001a5f80 sp=0xc0001a5f40 pc=0x425c686
runtime.main()
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:255 +0x227 fp=0xc0001a5fe0 sp=0xc0001a5f80 pc=0x4039967
runtime.goexit()
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0001a5fe8 sp=0xc0001a5fe0 pc=0x4066dc1

goroutine 6 [chan receive]:
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startRequestProcessor(0x0)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:101 +0x5a
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:86 +0x2d2

goroutine 7 [chan receive]:
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startMessageProcessor(0x0)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:96 +0x59
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:89 +0x314

goroutine 8 [chan receive]:
github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.(*Frontend).startCallbackProcessor(0x0)
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:106 +0x3d
created by github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend
	/Users/sandao/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.35/internal/frontend/desktop/darwin/frontend.go:90 +0x35b
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[进程已完成]

@stffabi
Copy link
Collaborator

stffabi commented Apr 29, 2022

Thanks @daodao97 for the report of the segfault. Could you please give PR #1362 a try? That should fix the issue.

@daodao97
Copy link
Contributor Author

Thanks @daodao97 for the report of the segfault. Could you please give PR #1362 a try? That should fix the issue.

Thanks, it is working.

@stffabi
Copy link
Collaborator

stffabi commented Apr 29, 2022

Awesome, thanks for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants