vite-pwa / vite-plugin-pwa

Zero-config PWA for Vite
https://vite-pwa-org.netlify.app/
MIT License
3.23k stars 211 forks source link

add-to-cache-list-conflicting-entries #715

Closed erfanmola closed 6 months ago

erfanmola commented 6 months ago

All of a sudden after upgrading the package version, I'm getting:

Uncaught (in promise) add-to-cache-list-conflicting-entries: add-to-cache-list-conflicting-entries :: [{"firstEntry":"https://eyfan.ir/assets/icons/android-chrome-192x192.png","secondEntry":"https://eyfan.ir/assets/icons/android-chrome-192x192.png?__WB_REVISION__=567053969aa578a81fd4da2bf83f8ec1"}]
    at O.addToCacheList (https://eyfan.ir/workbox-3e911b1d.js:1:11736)
    at O.precache (https://eyfan.ir/workbox-3e911b1d.js:1:11367)
    at https://eyfan.ir/workbox-3e911b1d.js:1:14994
    at Object.precacheAndRoute (https://eyfan.ir/workbox-3e911b1d.js:1:15006)
    at https://eyfan.ir/sw.js:1:673
    at https://eyfan.ir/sw.js:1:565

here is my config:

import { VitePWA } from 'vite-plugin-pwa'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [
    vue(),
    VitePWA({
      registerType: 'autoUpdate',
      injectRegister: 'auto',
      workbox: {
        globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
        navigateFallbackDenylist: [/^\/api/, /^\/files/],
      },
      manifest: {
        name: 'Eyfan',
        short_name: 'eyfan',
        description: 'Personal Blog of a FullStack Developer & DevOps',
        theme_color: '#E53935',
        icons: [
          {
            src: '/assets/icons/android-chrome-192x192.png',
            sizes: '192x192',
            type: 'image/png'
          },
          {
            src: '/assets/icons/android-chrome-maskable-512x512.png',
            sizes: '512x512',
            type: 'image/png'
          }
        ]
      }
    }),
  ],
});

My files are located in public/assets/icons.

userquin commented 6 months ago

try adding includeManifestIcons: false, you also have png files in the glob patterns

erfanmola commented 6 months ago

Thanks, includeManifestIcons: false did the trick.