pwa icon indicating copy to clipboard operation
pwa copied to clipboard

Manifest "add to home-screen" not loading

Open eeerrrttty opened this issue 7 years ago • 15 comments

After creating a vue init pwa and deploying, no 'add to home-screen' is shown on load.

Steps to reproduce:

vue init pwa firebase init (configure to a test project) firebase deploy enter the url displayed

eeerrrttty avatar Apr 29 '18 00:04 eeerrrttty

Same issue here. Does anyone know if Firebase needs to have a proper configuration to work with SW?

amaralDaniel avatar Apr 30 '18 23:04 amaralDaniel

Same issue here. I create a new project and when run it, the prompt to install don't appear

brunosc avatar May 08 '18 22:05 brunosc

Same here. Furthermore, the app scores 55% in lighthouse

failure does not register a service worker manifest start_url not cached by a service worker

africlouds avatar May 09 '18 14:05 africlouds

My score is 100% in production, however there isn't a prompt to install. This prompt is suggested by the browser based on an heuristic. I don't know if that is the problem because I've tested on another person phone and it still doesn't show up.

amaralDaniel avatar May 09 '18 15:05 amaralDaniel

Im here with 91% score in productin in audits. But really. Why doesn't the pop-up appear and how i will do ti? This is a crictical point.

eeerrrttty avatar May 09 '18 15:05 eeerrrttty

Maybe this will help you.

amaralDaniel avatar May 09 '18 22:05 amaralDaniel

U can trigger the prompt

window.addEventListener('beforeinstallprompt', function(event) {
    console.log("before install prompt")
    event.prompt();
  })

Not sure from where i get this but if it may be usefull

valentinlourteau avatar Jun 10 '18 19:06 valentinlourteau

So, where do i put this code? I putted it after log in, nothing happened

eeerrrttty avatar Jun 15 '18 14:06 eeerrrttty

I'm getting the same error as @africlouds on both dev and prod environments. While manually triggering the prompt seems like an appropriate workaround, it worries me that Chrome/Lighthouse doesn't recognize my app as a PWA. It makes me think that this might just be a symptom of a larger problem.

With that said, it appears that we'll need some boilerplate code which triggers the prompt anyway. Chrome 68 will no longer trigger the prompt automatically.

https://developers.google.com/web/fundamentals/app-install-banners/

bdaley avatar Jul 02 '18 18:07 bdaley

shouldn't this 'manual trigger' be included in the core code of pwa? Because i think all developers would like this.

eeerrrttty avatar Jul 03 '18 20:07 eeerrrttty

Same problem, I can't get the prompt to appear. You have to edit registerServiceWorker.js?

nacimgoura avatar Jul 05 '18 08:07 nacimgoura

this should either be built-in or a vue-pwa-install-prompt project should be created to shed light on this mystery!! we all need this!

btw auditing with lighthouse also said that my app doesn't register a service worker.. which sounds like blasphemy to me!

vesper8 avatar Jul 11 '18 08:07 vesper8

I ran into this issue as well, but realized it's because I edited out this line below from the index.html file: <%= htmlWebpackPlugin.options.serviceWorkerLoader %>

This line activates the service worker.

cathyhax avatar Jul 30 '18 16:07 cathyhax

I'm also trying to figure this out - out of the box service work registers and shows in chrome (both in sources and ://inspect/#service-workers) - I get an error in lighthouse that no usuable web app manifest was found (but it is served.) The error shows that url as /#/ - I wonder if this a problem with vue routing, I remember seeing somewhere in a tutorial how to hide /#/ from the URL.

jgalentine007 avatar Aug 10 '18 18:08 jgalentine007

I think changing the router mode to 'history' has solved the issue for me, lighthouse passes and workbox events show up in console!

Edit: I think the real problem is Azure App Service by default doesn't serve .json files, adding MIME type fixes.

jgalentine007 avatar Aug 10 '18 19:08 jgalentine007