Comments (18)
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
@OnlyFor Shouldn't be too complicated of a fix if you have the knowhow to controbute that would be great! If not thanks for raising the contribution and just raising bugs and helping identify replication steps is a great help!
from photoview.
i clone and test about 2 hours ago, and git clone https://github.com/photoview/photoview.git should be master of course
from photoview.
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:
https://stackoverflow.com/questions/49566059/service-worker-registration-error-unsupported-mime-type-text-html
from photoview.
can you post the first few lines of content of that service-worker.js file from the Browsers dev tools?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="icon" href="/photoview-logo.svg" type="image/svg+xml" /> <link rel="apple-touch-icon" href="/logo192.png" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> <link rel="manifest" href="/manifest.json" /> <meta name="apple-mobile-web-app-title" content="Photoview" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="white" /> <script type="module" crossorigin src="/assets/index.9b57b0a0.js"></script> <link rel="stylesheet" href="/assets/index.0ac106ed.css"> </head> <body> <noscript>You need to enable JavaScript to run Photoview.</noscript> <div id="root"></div> </body> </html>
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).
from photoview.
@OnlyFor, I checked the image viktorstrate/photoview:master
and don't see this error. The demo site is running the latest released image, which is pretty old. Can you please test the PWA installation from your side using the master tag for the image?
from photoview.
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 ?
for example, it said "cp -r ui/build/ app/ui/", but what i actually found is "cp -r ui/dist/ app/ui"
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?
from photoview.
Assuming that you used the source code from master
(hope that pulled not too long time ago), it should work.
@jordy2254, can you please take a look, as I never built the project locally?
from photoview.
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.
from photoview.
The serviceworker.js file cannot be found.
its strange, but I cannot reproduce the issue. I've tried using the latest master
image from the server in Chrome and Firefox, then from a remote host in the same browsers: in all cases I see in the Network tab of Dev Tools that the service-worker.js
is loaded with 200 OK status.
I found the next line in the code:
const swUrl = '${import.meta.env.BASE_URL}service-worker.js'
If you have this issue in your setup, please make sure that the PHOTOVIEW_LISTEN_IP
variable is set to the hostname of the photoview service in your docker-compose file. In my case it is the PHOTOVIEW_LISTEN_IP: "photoview"
from photoview.
can you post the first few lines of content of that service-worker.js file from the Browsers dev tools?
from photoview.
can you post the first few lines of content of that service-worker.js file from the Browsers dev tools?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/photoview-logo.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/logo192.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="/manifest.json" />
<meta name="apple-mobile-web-app-title" content="Photoview" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<script type="module" crossorigin src="/assets/index.9b57b0a0.js"></script>
<link rel="stylesheet" href="/assets/index.0ac106ed.css">
</head>
<body>
<noscript>You need to enable JavaScript to run Photoview.</noscript>
<div id="root"></div>
</body>
</html>
from photoview.
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".
Ive tried different settings (just the subdomain of my host, or the entire domain (sub.domain.tld), but that didnt change anything. What is that value supposed to be?
from photoview.
The LISTEN_IP is still unchanged and set to "photoview".
it depends on your deployment type:
- if you use docker, then it should be set to the Photoview service's hostname in the docker-compose file. In most cases that is "photoview"
- if you install Photoview on the host directly, then this should be the environment variable, set to the host IP or hostname. Try local network IP or name and test from the local network: if the issue is gone, then this is the cause and you need to find a way to configure it to work for all use cases
from photoview.
it runs with docker compose. Therefore it was already correct with "photoview".
but if this is used to determine the URL for the service-worker shouldnt it be set to the actual domain thats being used even if everything runs inside Docker?
from photoview.
shouldn't it be set to the actual domain
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((
from photoview.
Related Issues (20)
- Tech debt - service dao layers for api HOT 2
- add ImageMagick Support
- Frontend notification improvements HOT 1
- Access link is not reloaded on the sidebar under "Sharing options" if user clicks on (i) of different media without closing the sidebar
- User Authentication - password requirements HOT 1
- Add custom RAW format conversion tool support
- Guest user access. HOT 7
- Lots of vulnerabilities in UI HOT 2
- Darktable is out of date on edge docker image HOT 6
- [Security vulnerability]: Photoview outputs the DB connection string as a plain text to the log
- Add an auto-fix broken media step to the scanner job HOT 1
- Plex Support
- Removal of generated files from version control HOT 6
- panic: runtime error: invalid memory address or nil pointer dereference HOT 4
- TRACKING ISSUE: For 3.0 release
- Permission denied error for folders, mounted from the host to the `photoview` container (cache and media library folders) HOT 7
- Can't access phototview web ui with k8s configuration. HOT 4
- Create CONTRIBUTING.md document HOT 1
- Placeholder issue: Fix various issues, reported by Code analysis tools
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photoview.