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

Admin panel is not opening on Windows #6

Closed
FeodorFitsner opened this issue Jul 7, 2022 · 18 comments
Closed

Admin panel is not opening on Windows #6

FeodorFitsner opened this issue Jul 7, 2022 · 18 comments
Labels
bug Something isn't working

Comments

@FeodorFitsner
Copy link

While trying to open Admin panel at http://localhost:8090/_/ on Windows 11 I'm getting blank page and the following error in a browser console:

index.944ee0db.js:1 
        
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

Browser: Microsoft Edge 103.0.1264.49

@ganigeorgiev
Copy link
Member

Hm, that's strange.

I'll try later installing Edge on Linux to see if I it could reproduce it.

@ganigeorgiev ganigeorgiev added the bug Something isn't working label Jul 7, 2022
@FeodorFitsner
Copy link
Author

Thanks! I remember fixing that with adding a MIME type for .js: https://github.com/flet-dev/flet/blob/main/server/server/server.go#L71

@enxoco
Copy link

enxoco commented Jul 7, 2022

Seems to be working fine for me. I am also on Windows 11 and the same build of Microsoft Edge. I originally launched it in Brave and set up a couple collections. Not sure if that would make a difference.

@ganigeorgiev
Copy link
Member

I've installed and tried Edge on Linux but wasn't able to reproduce it, so the issue is not browser related and it's most likely platform dependent.

There is a very similar issue reported in the golang repo - golang/go#32350

I'm currently downloading a Windows 11 VM to test it locally, but it'll take some time.

@ganigeorgiev
Copy link
Member

I've just tested it on a Windows 10 VM 17.17134 with installed latest edge and chrome and everything seems OK.

I wasn't able to test on a Windows 11 VM, because the only official image I could find was ~20GB and for my location it'll takes more than 2 hours to download.

@FeodorFitsner Could you share your exact Windows version?

In any case, it seems that a fix already landed in go but probably would be available with go1.19 (this August) - golang/go@52f68ef

@FeodorFitsner
Copy link
Author

Windows 11 Version 10.0.22000.739

@matt-clegg
Copy link

I'm getting the same issue in Windows 10 21H2 19044.1766 in Firefox 102.0.1 (64-bit).

@ganigeorgiev
Copy link
Member

@FeodorFitsner, @matt-clegg when you find time, could you check also with the v0.1.1 binary - https://github.com/pocketbase/pocketbase/releases/download/v0.1.1/pocketbase_0.1.1_windows_amd64.zip ?
(it is built with go1.19.0-beta.1 that supposedly is expected to "fix" the issue).

@matt-clegg
Copy link

@ganigeorgiev Just tested the v0.1.1 binary on Windows 10 and it seems to be working now! However it did seem to take around 25 seconds for the admin dashboard to become accessible. I was stuck on an "Unable to connect" screen in Firefox.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jul 8, 2022

Thanks for testing. That's unexpected, it shouldn't take more than a couple of seconds max to load the ui.
I'll try to upgrade my Windows 10 vm to the version you are using and will test it again.

Adding mime.AddExtensionType(".js", "application/javascript") as @FeodorFitsner suggested before initializing the application would probably fix the issue without the need of go 1.19, but I want to avoid that because this a unintentional Windows registry misconfiguration, that they probably will patch with a future update (I'm actually surprised that the go team agreed to make an exception for this case in their code).

@FeodorFitsner
Copy link
Author

@ganigeorgiev just tested with v0.1.1 binary and got this wierd error:

PS C:\Users\feodo\Downloads\pocketbase_0.1.1_windows_amd64> .\pocketbase.exe serve
> Server started at: http://localhost:8090
  - REST API: http://localhost:8090/api/
  - Admin UI: http://localhost:8090/_/
2022/07/08 08:25:03 listen tcp: lookup localhost on 1.1.1.1:53: no such host

Is it my network configuration or why is it trying to reach 1.1.1.1?

@ganigeorgiev
Copy link
Member

@FeodorFitsner Hm, this should be something with the local network configuration. Are you using a VPN?

@FeodorFitsner
Copy link
Author

Please nevermind, it's on my router. Strange, that previous binary worked - must be something changed in Go 1.19 regarding that. Could you point me to a place in your code where you start the server with localhost binding? I'd like to do a repro. Thanks!

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jul 8, 2022

@FeodorFitsner You could find the code here - https://github.com/pocketbase/pocketbase/blob/master/cmd/serve.go#L77

If you don't have localhost in your /etc/hosts file, you could also try starting the application with --http="127.0.0.1:8090"

@FeodorFitsner
Copy link
Author

Indeed, in C:\Windows\System32\drivers\etc\hosts I have localhost section commented:

# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost

Starting with --http="127.0.0.1:8090" did the trick and I'm able to see Admin panel now!

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Jul 8, 2022

@matt-clegg Just downloaded and installed an official Evaluation Windows 10 21H2 VM and I' not able to reproduce the slow start up time - the application seems to be loading normally to me (aka. under a second).

I'll close the issue for now and will add a note in the documentation/readme to use go 1.19 on window, but if someone else is still experiencing issues, feel free to comment and I'll reopen it.

@waterdrw
Copy link

i'm serve in ubuntu 16.04 :)

MX record result here
image

i serve --http="127.0.0.1" --debug mode. but no errors or warnings

@ganigeorgiev
Copy link
Member

@waterdrw Please post in the related discussion #298 since you'll have better visibility and other users may be able to help.

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

5 participants