Comments (7)
If using SSR app, you will need to prerender index.vue page (that's the fallback page /). Check vite-pwa/sveltekit#65 (comment) .
from nuxt.
@userquin
did you mean pre-render the / page ?
prerender: [
routes: ['/']
]
from nuxt.
yes
from nuxt.
@userquin I already added the dynamic routes, so it will be pushed to prerender.routes
async 'nitro:config'(nitroConfig) {
if (nitroConfig.dev) { return }
const getMenuItem = useMenuNavigation()
const response = await fetch(`${process.env.INTERNAL_API_URL}/api/globalMenuItems`)
const { main_menu } = await response.json()
if (nitroConfig.prerender && nitroConfig.prerender.routes) {
nitroConfig.prerender.routes?.push(...main_menu.map((item) => getMenuItem(item).link))
}
console.log(nitroConfig.prerender, 'nitroConfig.prerender')
}
still no any changes, page is working on refresh but not when I navigate to another page
from nuxt.
Create a minimal reproduction using @vite-pwa/create-pwa
, I'll try to check it later...
Check https://vite-pwa-org.netlify.app/guide/scaffolding.html : select Vue and then Nuxt when selecting the framework
from nuxt.
okay @userquin I will make it
if I wanted it to redirect to simple offline.vue file which normally says( your are offline now ) instead of default offline page
what should I do for that ?
it would be very helpful if you can answer it
my client needs it urgently for a quick fix
Much thanks @userquin
from nuxt.
If you want to redirect to custom page (pages/offline.vue
), you need to prerender the route, otherwise you will get infinite redirection when offline. In the runtime caching just redirect to that page route (/offline
): you can add some logic in the callback, iirc you have the original request, or just add it to the context and use it (check callbacks params)
from nuxt.
Related Issues (20)
- 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
- 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
- Can only visit url with trailing slash once
- Nuxt 3.12.3 composable types break when @vite-pwa/nuxt is installed HOT 20
- How can i make a dialog HOT 3
- @vite-pwa/assets-generator and @vite-pwa/nuxt give error only in production, related to workbox HOT 4
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.