Comments (4)
@szulcus you can wrap with ClientOnly
the VitePwaManifest
and your component using $pwa
. I need to review plugin registration, it seems Nuxt not picking the proper mode: https://github.com/nuxt/nuxt/blob/main/packages/kit/src/plugin.ts#L36-L39
from nuxt.
@userquin thanks for your fast response. I wrap this component with client-only
, but I don't see any difference.
With module and client component:
Without module and with client component:
I don't use $pwa
variable anywhere. By the way, I also have a question. Is / will it be possible to define a manifest from some macro (something like useHead macro and component https://nuxt.com/docs/getting-started/seo-meta)? I'm not a fan of using components for this type of thing.
from nuxt.
@szulcus yeah, you're in test mode and so we need a TestAware
sfc wrapper, maybe you can check import.meta.env.MODE
(Vitest will expose it with test
):
// components/TestAware.client.ts
import { defineComponent } from 'vue'
export default defineComponent({
async setup(_props, { slots }) {
if (import.meta.env.MODE === 'test') {
return () => null
}
return () => {
return slots.default && slots.default({})
}
},
})
Then wrap your SFC using the $pwa
with <TestAware><YourSFC /></TestAware>
, I'll try to add it next week...
from nuxt.
I don't use
$pwa
variable anywhere. By the way, I also have a question. Is / will it be possible to define a manifest from some macro (something like useHead macro and component https://nuxt.com/docs/getting-started/seo-meta)? I'm not a fan of using components for this type of thing.
Uhmm, so the problem seems to be the auto registration, but if not used why is it failing (check the stack trace)?
You can use the virtual (virtual:pwa-info
) and add your own logic, just check https://github.com/vite-pwa/nuxt/blob/main/src/runtime/VitePwaManifest.ts
from nuxt.
Related Issues (20)
- [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
- Cannot find module '#pwa' or its corresponding type declarations. HOT 2
- vite-pwa/nuxt not working on ios
- Module does nothing ? (EDIT: No Firefox support ?) HOT 9
- Nuxt3 + PWA warnings in terminal HOT 6
- cant use npm run build
- I can't get 'start_url' to work for me
- showInstallPrompt not being called HOT 1
- Uncaught ReferenceError: __NUXT_ASYNC_CONTEXT__ is not defined HOT 7
- Service Worker "import sentry-release-injection" error when loading page HOT 19
- @vite-pwa/nuxt and vue-tsc conflict HOT 4
- API Request URLs Open in New Tab Redirect to 404 Page HOT 2
- Generate PWA Assets functionality not works when srcDir is not default HOT 15
- Default value of navigateFallbackAllowlist
- offline mode: when I navigate to another route, it shows nothing, but when I refresh then it shows the page from cache HOT 7
- Vite-pwa/nuxt not caching pages on a client-side rendered app HOT 3
- How to handle i18n ? HOT 1
- assets generation not working with nuxt 4 without this workaround HOT 2
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.