-
-
Notifications
You must be signed in to change notification settings - Fork 21
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.showInstallPrompt always false? #48
Comments
@ampharino weird, are you testing in Chrome (or any Chromium based browser, not all browsers support this feature)? The PWA must not be installed: https://github.com/vite-pwa/nuxt/blob/main/templates/pwa.client.ts#L95. FYI: Elk's custom PWA module was pulled here with the help of Daniel |
@userquin I'm testing in chrome. I can confirm that the PWA is not installed. |
You need to add the webmanifest and check the service worker is Green in dev tools. |
@userquin Service worker is green and the app is installable. I'm just using the auto generated service worker |
Your pwa manifest seems to not have icons entry, you need at least 2 icons: 192×192 and 512×512 |
@userquin I do have an icons entry. Maybe related, but if I do a hard refresh nuxt gives me a 500 error
|
Use |
Ah ok thank you that fixes the hard refresh issue |
Could not reproduce the issue with the same pwa config in a fresh nuxt 3 project 🤔 |
@userquin I could get it working briefly. I deleted Any ideas? Here is my
|
@ampharino can you share a minimal repo? |
I was able to resolve the issue and get everything working by wrapping |
@ampharino it is weird, I'll check it on a new nuxt project, but the virtual used in the component should be ok with SSR EDIT: can you provide the repo 🙏 ? |
@userquin I tried reproducing the issue on a new nuxt project but am unable to and unfortunately I can't share the actual repo. Lets just consider this issue resolved 🙏 |
I'm building a Nuxt 3 app and would like to show an install prompt if the user has not installed the PWA yet. From reading the docs, my understanding is that I could just check the value of
$pwa.showInstallPrompt
like the way elk does it to determine whether to show the prompt. However, it seems like the value is always false. What am I missing?Here's my pwa config in
nuxt.config.ts
.The text was updated successfully, but these errors were encountered: