asticode / go-astilectron-bundler

Bundle your Astilectron app with ease
MIT License
127 stars 67 forks source link

Not allowed to load local resource (Linux AMD64) #63

Closed Happy-Ferret closed 4 years ago

Happy-Ferret commented 4 years ago

Hi.

I have the problem that, under GNU/Linux (Microsoft WSL), the desktop build of my app fails to load with the following error logged to debug.

Not allowed to load local resource: file:///mnt/c/Users/user/Desktop/git/yggdrasil/resources/app/index.html%3Flang=C

The same app works fine under Windows.

asticode commented 4 years ago

Can you share the args you're passing to the NewWindow method ?

Happy-Ferret commented 4 years ago

I'm using go-astilectron-bootstrap, so it looks as follows:

Windows: []*bootstrap.Window{{
            Homepage:       "index.html?lang=" + lang,
            MessageHandler: handleMessages,
            Options: &astilectron.WindowOptions{
                BackgroundColor: astikit.StrPtr("#5cc070"),
                Center:          astikit.BoolPtr(true),
                Height:          astikit.IntPtr(700),
                Width:           astikit.IntPtr(700),
            },
        }},

Where lang is a string like "en" or "fr", typically.

asticode commented 4 years ago

Does the path /mnt/c/Users/user/Desktop/git/yggdrasil/resources/app/index.html exist on your machine ?

Happy-Ferret commented 4 years ago

I'm currently away, but that's interesting. I believe it's missing the "desktop-app" in-between "yggdrasil" and "resources".

asticode commented 4 years ago

Since you've posted the issue in the bundler repo, I assume that you're using it. Can you :

I'd like to see how paths are handled in the process.