swingmx / swingmusic

Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
https://swingmx.com
MIT License
757 stars 41 forks source link

Windows: Opening Webapp Page in Browser is Blank #137

Closed g33k247 closed 1 year ago

g33k247 commented 1 year ago

Downloaded the Windows version of the app. Opens and provides the information below but when the browser connects, the session is "blank" and no data is displayed whatsoever. I do see "Swing Music" on the browser's tab. Duplicated in Google Chrome, Mozilla FireFox, and Microsoft Edge.

The data folder at C:\Users\username.swingmusic was created.

SwingMusic v1.2.0
Started app on:
➤ http://localhost:1970
------------------------------

Extract featured artists from titles: True
Remove prod. from titles: True
Data folder: C:\Users\g33k2\.swingmusic

 * Serving Flask app 'app.api'
 * Debug mode: off
WatchDogInfo: No root directories configured. Watchdog not started.
Loading tracks: 0it [00:00, ?it/s]
Loading albums: 0it [00:00, ?it/s]
Mapping album colors: 0it [00:00, ?it/s]
Loading artists: 0it [00:00, ?it/s]
Removing deleted tracks: 0it [00:00, ?it/s]
The root directory is not configured. Open the app in your webbrowser to configure.
Downloading artist images: 0it [00:00, ?it/s]
cwilvx commented 1 year ago

@g33k247

Thanks for opening this issue. Please check if there's any errors on the console in the browser.

g33k247 commented 1 year ago

Here's what I see in my terminal:

image

and what my browsers look like:

image

cwilvx commented 1 year ago

On the blank page, press CTRL + SHIFT + I, or right click and select "Inspect". Switch to the console tab and check if there are any errors. Take a screenshot and attach it to this thread.

image

The issue seems to be related to the web page and not the server.

g33k247 commented 1 year ago

Here's what I see: image

g33k247 commented 1 year ago

Here's the same view from Firefox: image

cwilvx commented 1 year ago

Hey @g33k247

After digging around, I think I found the problem. It has something to do with your Windows registry, but I will patch it on the app in the next release.

See https://github.com/pallets/flask/issues/1045#issuecomment-42202749 for more info about the registry thing.

g33k247 commented 1 year ago

Looks like my registry is set correctly to text/css. Of note, I have successfully run the app from a docker container on my Windows machine so that implies the browser is fine.

cwilvx commented 1 year ago

@g33k247

The errors from the browser console indicated that .js mime were set to text/plain can you check that too in your windows registry? The javascript wasn't being loaded properly.

g33k247 commented 1 year ago

I made the update for the .js mime type. Perhaps it should not be text/js?

Loading module from “http://localhost:1970/assets/index.639b5e4b.js” was blocked because of a disallowed MIME type (“text/js”).

g33k247 commented 1 year ago

I changed the mime type to javascript per this reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types.

Now it works!!

cwilvx commented 1 year ago

@g33k247

I've implemented (but not yet tested) an in-app fix to the registry issue. Basically, to serve the files with a preset mime type that doesn't depend on the registry.

Alright!

Enjoy. I'd like have your feedback on your experience with the app. If you ran into issues, or have any suggestions, please open an issue.

... I'm putting together a bunch of bug fixes and implementing missing & new features for the next release. Feel free to reach out.

Thanks.