Warning - One of the glob patterns doesnt match any files.
I get a warning message when building my project:
warnings:
One of the glob patterns doesn't match any files. Please remove or fix the following: {
"globDirectory": "/Users/elmaco/WebstormProjects/GeoQuestr/.output/public",
"globPattern": "**/_payload.json",
"globIgnores": [
"**/node_modules/**/*",
"sw.js",
"workbox-*.js"
]
}
Even if my globPatterns array is empty.
How can it be? I dont understand how to fix this issue.
pwa: {
...
registerType: 'prompt',
workbox: {
maximumFileSizeToCacheInBytes: 50 * 1024 * 1024, // 50MB
globPatterns: [],
navigateFallback: null,
runtimeCaching: [
{
urlPattern: /\.(?:js|mjs|cjs|mp4|png|webp|svg|ico|css|glb|ttf|webmanifest|txt)$/,
handler: 'CacheFirst', // Fetch from cache, fallback to network
options: {
cacheName: 'js-cache',
expiration: {
maxEntries: 20,
maxAgeSeconds: 360 * 24 * 60 * 60, // Cache JS files for 360 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
Hey @crunchwrap89 are you by any chance using nuxt 4 compat?
Also getting this.
Edit: According to the docs, enabling experimental payloadExtraction produces this file and adds it to the glob patterns. https://vite-pwa-org.netlify.app/frameworks/nuxt.html#payload-extraction
Nuxt apparently enables this by default now. Manually disabling payloadExtraction makes the error go away: https://nuxt.com/docs/guide/going-further/experimental-features#payloadextraction
What is the benefit of this feature? I don't know
I am running latest version of nuxt, but have had this warning for atleast a year.
Den tors 13 feb. 2025 20:52galaxyblur @.***> skrev:
also getting this
— Reply to this email directly, view it on GitHub https://github.com/vite-pwa/nuxt/issues/169#issuecomment-2657574063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUQCTXU2I6QW5JYXIK7PA32PTZXFAVCNFSM6AAAAABQNCG4SOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJXGU3TIMBWGM . You are receiving this because you were mentioned.Message ID: @.***> [image: galaxyblur]galaxyblur left a comment (vite-pwa/nuxt#169) https://github.com/vite-pwa/nuxt/issues/169#issuecomment-2657574063
also getting this
— Reply to this email directly, view it on GitHub https://github.com/vite-pwa/nuxt/issues/169#issuecomment-2657574063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUQCTXU2I6QW5JYXIK7PA32PTZXFAVCNFSM6AAAAABQNCG4SOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJXGU3TIMBWGM . You are receiving this because you were mentioned.Message ID: @.***>
I'll check if the payload option moved from experimental option
I solved the problem with this solution.
experimental: { payloadExtraction: false, appManifest: false, }, pwa: { workbox: { navigateFallback: "/", globPatterns: [], globIgnores: [ '/_payload.json', '_nuxt/builds//.json', '/node_modules//' ] }, }
Hi,
It seems the issue only occurs when this setting is on:
experimental: { payloadExtraction: true, },
Warning dissappears with setting: payloadExtraction: false.
"payloadExtraction Enables extraction of payloads of pages generated with nuxt generate."
Since i am not using nuxt generate to build, i am using a SPA/SSR app with "nuxt build" only, i guess no _payload.json is created for me, and therefore it will not match in the globpattern.
Would be good if this lib only added "/_payload.json" to the globPatterns if using nuxt generate.