-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
PWA seems break ? #938
Comments
@OnlyFor, I checked the image |
docker is too heavy for my hosting, so i install manually according here: https://photoview.github.io/en/docs/installation-manual/ it looks like this docs is out of date ? and after npm run build, this is no "service-worker.js" under ui/dist, which is used in serviceWorkerRegistration.ts, I'm not good at front-end, so I don't know what's going on, and I did a little test, if i delete "serviceWorkerRegistration.register()" in "src/index.tsc", i could install pwa in chrome desktop but without icon ? and it seems can't be installed in android chrome lastest still ? I checked some other projects and said that upgrading dependencies solved this problem? |
Assuming that you used the source code from @jordy2254, can you please take a look, as I never built the project locally? |
i clone and test about 2 hours ago, and git clone https://github.com/photoview/photoview.git should be master of course |
I believe this is the way that we serve files through go where it doesn't add the correct type onto the file when serving it thus the browser blocks it. It should be a straight forward fix, and the association for the serve handling in the go code can be found here; https://github.com/photoview/photoview/blob/master/api/server.go#L98 |
I do not think this is about file associations. the service-worker file is not there and its just the 404 error page that has the wrong mime-type. |
I have the same issue with the latest docker installation. Fresh Debian server with nginx as reverse-proxy and standard-configuration. The serviceworker.js file cannot be found. looks like the solution is here: |
its strange, but I cannot reproduce the issue. I've tried using the latest I found the next line in the code: If you have this issue in your setup, please make sure that the |
can you post the first few lines of content of that service-worker.js file from the Browsers dev tools? |
|
In my case the service-worker.js returns a 404 page. So I cannot share any code. The LISTEN_IP is still unchanged and set to "photoview". |
it depends on your deployment type:
|
it runs with docker compose. Therefore it was already correct with "photoview". |
in my case it works fine with the "photoview" value in the compose file, but feel free to try) then, I don't have any other thoughts as to why it doesn't work for you(( |
you see? this is not the service worker which should be a javascript file, but instead is just the file-not page that comes with status code 200. the service worker seems not to bundled correctly and is therefore not in the production build and the deployment (at least not under that url). |
I played with this issue a bit today and could not find any solution:
So, we need some help from a frontend dev with experience in docker. |
Describe the bug
A clear and concise description of what the bug is.
PWA is not working
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
install pwa show and can install
Screenshots
in network console shows:
"index.f9413d49.js:224 Error during service worker registration: DOMException: Failed to register a ServiceWorker for scope ('https://photos.qpqp.dk/') with script ('https://photos.qpqp.dk/service-worker.js'): The script has an unsupported MIME type ('text/html')."
Your environment:
Feel free to remove and add what you think might be useful.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: