pocketbase / pocketbase

Open Source realtime backend in 1 file

Home Page:https://pocketbase.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Admin panel is not opening on Windows

FeodorFitsner opened this issue · comments

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

Hm, that's strange.

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

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

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.

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.

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

Windows 11 Version 10.0.22000.739

commented

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

@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).

commented

@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.

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).

@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?

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

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!

@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"

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!

@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.

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

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