Fix PWA manifest link injection and navigateFallback error
- Add useHead() in app.vue to inject manifest and PWA meta tags - Set navigateFallback to undefined to prevent non-precached-url error - Add includeAssets configuration for PWA module - Fixes service worker error on initial page load 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -50,4 +50,18 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { isAuthenticated } = useAuthentik()
|
const { isAuthenticated } = useAuthentik()
|
||||||
|
|
||||||
|
// Configurar meta tags para PWA
|
||||||
|
useHead({
|
||||||
|
link: [
|
||||||
|
{ rel: 'manifest', href: '/manifest.webmanifest' },
|
||||||
|
{ rel: 'icon', type: 'image/svg+xml', href: '/icon.svg' },
|
||||||
|
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }
|
||||||
|
],
|
||||||
|
meta: [
|
||||||
|
{ name: 'theme-color', content: '#00DC82' },
|
||||||
|
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||||
|
{ name: 'apple-mobile-web-app-status-bar-style', content: 'default' }
|
||||||
|
]
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export default defineNuxtConfig({
|
|||||||
|
|
||||||
pwa: {
|
pwa: {
|
||||||
registerType: 'autoUpdate',
|
registerType: 'autoUpdate',
|
||||||
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg'],
|
||||||
manifest: {
|
manifest: {
|
||||||
name: 'Plantilla Nuxt + Authentik',
|
name: 'Plantilla Nuxt + Authentik',
|
||||||
short_name: 'NuxtAuth',
|
short_name: 'NuxtAuth',
|
||||||
@@ -54,7 +55,7 @@ export default defineNuxtConfig({
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
workbox: {
|
workbox: {
|
||||||
navigateFallback: '/',
|
navigateFallback: undefined,
|
||||||
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
|
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
|
||||||
cleanupOutdatedCaches: true,
|
cleanupOutdatedCaches: true,
|
||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
|
|||||||
Reference in New Issue
Block a user