Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SvelteKit: when using devOptions: enabled, warnings : One of the glob patterns doesn't match any files. Please remove or fix the following #436

Closed
xmlking opened this issue Dec 27, 2022 · 11 comments · Fixed by #531

Comments

@xmlking
Copy link

xmlking commented Dec 27, 2022

SvelteKit: when using devOptions: enabled = true, I noticed the following warnings
don't understand what caused those warnings or it is a bug

precache  1 entries (0.00 KiB)
files generated
  dev-dist/sw.js
  dev-dist/workbox-d2a14864.js
warnings
  Some items were passed to additionalManifestEntries without revisioning info. This is generally NOT safe. Learn more at https://bit.ly/wb-precache.
  - /

  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/schintha/Developer/Work/SPA/svelte-starter-kit/dev-dist",
  "globPattern": "client/**/*.{js,css,ico,png,svg,webp}",
  "globIgnores": [
    "**/node_modules/**/*",
    "sw.js",
    "workbox-*.js"
  ]
}
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/schintha/Developer/Work/SPA/svelte-starter-kit/dev-dist",
  "globPattern": "prerendered/**/*.html",
  "globIgnores": [
    "**/node_modules/**/*",
    "sw.js",
    "workbox-*.js"
  ]
}

image

@A2-NieR
Copy link

A2-NieR commented Jan 28, 2023

Do you have a glob pattern inside your vite config file?

Encountered the same problem by blindly copying the config of the SvelteKit example and the solution for me was to remove the setting: #120 (comment)

@userquin
Copy link
Member

@xmlking @bunnythelifeguard you can ignore this warning, on dev mode there is nothing in the sw precache, only the navigation fallback: I'll try to remove the warning changing the globPattern when using dev mode.

Whether or not you have a globPattern included doesn't matter, workbox uses a default one that includes css, js and html.

@danawoodman
Copy link

fwiw I'm still seeing this in a recent build with SvelteKit + dev mode enabled without a glob pattern in my config

@userquin
Copy link
Member

userquin commented Jun 2, 2023

@danawoodman I guess there is no way to remove the warning, if you check the dev-dist folder created, it will only ontain the sw and the workbox-** asset: the only way to remove it is to not log workbox warnings when building it, I'll try to fix it...

@userquin
Copy link
Member

userquin commented Jun 2, 2023

Should be fixed in v0.16.3, I'll add a new entry in the docs...

Add suppressWarnings: true to devOptions, it will generate an empty suppress-warnings.js inside dev-dist folder and change globalPatterns to ['*.js'].

The additionalManifestEntries without revision also fixed adding object notation with random string in revision.

EDIT: docs updated, suppress warnings can be found in FAQ (last entry)

@danawoodman
Copy link

Thanks @userquin! Will this be released in @vite-pwa/sveltekit?

@userquin
Copy link
Member

userquin commented Jun 5, 2023

Reinstall kit plugin or reinstall pwa plugin

@danawoodman
Copy link

danawoodman commented Jun 8, 2023

I've removed package-lock.json, node_modules, my build directories, uninstalled and reinstalled vite-plugin-pwa and @vite-pwa/sveltekit and added supressWarnings: true to devOptions but I'm still seeing the warning. Anything else to try? I don't have any glob patterns in my vite.config.ts

I see @vite-pwa/sveltekit was last updated 21 days ago on npm, is that an issue?

@userquin
Copy link
Member

userquin commented Jun 9, 2023

I need to update pwa kit plugin dependencies...

@userquin
Copy link
Member

userquin commented Jun 9, 2023

@danawoodman released 0.2.3

@danawoodman
Copy link

Thanks! The errors have gone away 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants