Comments (14)
@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 🙏
from nuxt.
@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
from nuxt.
@userquin I'm testing in chrome. I can confirm that the PWA is not installed. $pwa.isInstalled
is returning the correct value.
I can get the prompt to show if I do <PwaInstallPrompt v-if="!$pwa.isInstalled"/>
from nuxt.
You need to add the webmanifest and check the service worker is Green in dev tools.
from nuxt.
@userquin Service worker is green and the app is installable. I'm just using the auto generated service worker
from nuxt.
Your pwa manifest seems to not have icons entry, you need at least 2 icons: 192×192 and 512×512
from nuxt.
@userquin I do have an icons entry.
Maybe related, but if I do a hard refresh nuxt gives me a 500 error
[3:15:02 PM] [Vue warn]: Property "$pwa" was accessed during render but is not defined on instance.
[3:15:02 PM] [nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'showInstallPrompt')
at _sfc_ssrRender (./pages/[locale]/index.vue:62:17)
at renderComponentSubTree (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:683:9)
at ./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:629:25
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:870:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
at async unrollBuffer$1 (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:875:16)
from nuxt.
Use "$pwa?.<prop>"
from nuxt.
Ah ok thank you that fixes the hard refresh issue
from nuxt.
Could not reproduce the issue with the same pwa config in a fresh nuxt 3 project 🤔
from nuxt.
@userquin I could get it working briefly. I deleted <VitePwaManifest/>
from app.vue
, wait for hmr update and then add it back and wait for hmr update again it works. However if I refresh the page after this, it no longer works. Only difference I've found is that there are two web manifests when its working.
Any ideas?
Here is my app.vue
. template
<template>
<NuxtLayout>
<VitePwaManifest/>
<div>
<NuxtPage />
</div>
</NuxtLayout>
</template>
from nuxt.
@ampharino can you share a minimal repo?
from nuxt.
I was able to resolve the issue and get everything working by wrapping <VitePwaManifest/>
inside <ClientOnly>
nuxt component. Let me know if you still want a minimal repo for further investigation
from nuxt.
@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 🙏 ?
from nuxt.
Related Issues (20)
- refresh dosen`t work when I setup vite-pwa into my nuxt app HOT 1
- Specyfing different theme colors in manifest for dark mode HOT 1
- State gets lost with "soft" reset when using @vite-pwa/nuxt and nuxt-auth-utils HOT 5
- How to disable caching "_nuxt" folder due to "The server responded with a status of 429" after every update!!! HOT 4
- How to use it with useAsyncData? HOT 1
- Service worker keeps showing 'trying to install' when using `app.baseURL` under injectManifest strategy HOT 1
- Importing the virtual module in a unit test with Vitest HOT 2
- npm WARN when run "npm i @vite-pwa/nuxt -D" HOT 3
- [Feature Request]: dynamic manifest.json via nitro HOT 2
- pwa does not cache data in Nuxt 3 SSR HOT 3
- Firefox injectManifest not working HOT 1
- Manifest.webmanifest Failed to load resource: the server responded with a status of 401 HOT 3
- Problems on fresh app dev and prod HOT 3
- "@vite-pwa/nuxt": "^0.1.1" - manifest.webmanifest is 404 HOT 5
- module augmentation breaks others modules with unknown type
- Upgrade from v0.1.2 to v0.2.1 throws an error HOT 6
- Updating Nuxt to 3.8.1 breaks the globPatterns HOT 2
- Doesn't include public assets in nuxt v3.8.2. HOT 5
- Include appManifest in manifestEntries HOT 4
- `@nuxt/shema` module augmentation with vuetify entries!
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 nuxt.