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

The assetserver.Options.Handler does not work in dev mode #3944

Open
eryx opened this issue Dec 12, 2024 · 1 comment
Open

The assetserver.Options.Handler does not work in dev mode #3944

eryx opened this issue Dec 12, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@eryx
Copy link

eryx commented Dec 12, 2024

Description

type custemHttpHandler struct {}

func (h *custemHttpHandler) ServeHTTP(wr http.ResponseWriter, req *http.Request) {
  log.Printf("handler serve %s", req.URL.Path)
}

err := wails.Run(&options.App{
  AssetServer: &assetserver.Options{
    Assets:  assets,
    Handler: &custemHttpHandler{},
  },
})

To Reproduce

wails dev

log output:

DEB | [AssetHandler] File 'file/id/e6d95e4' not found, serving '/file/id/e6d95e4' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/file/id/e6d95e4'

Expected behaviour

use wails build and exec "./build/bin/myproject.app/Contents/MacOS/myproject" working fine.

log output:

DEB | [AssetHandler] File 'file/id/e6d95e4' not found, serving '/file/id/e6d95e4' by AssetHandler
handler serve file/id/e6d95e4

Screenshots

No response

Attempted Fixes

No response

System Details

# Wails
Version | v2.9.2

# System

| OS           | MacOS                                                                                                                 
| Version      | 14.6.1                                                                                                                 
| Go Version   | go1.23.2                                                                                                               
| Platform     | darwin                                                                                                                 
| Architecture | arm64

Additional context

No response

@eryx eryx added the Bug Something isn't working label Dec 12, 2024
@leaanthony
Copy link
Member

Trying to load Go assets from the Vite port in this way isn't going to work. Try opening http://localhost:34115

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

2 participants