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

Build fails due to VitePWA #34

Closed
zigomir opened this issue Jan 9, 2021 · 4 comments
Closed

Build fails due to VitePWA #34

zigomir opened this issue Jan 9, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@zigomir
Copy link

zigomir commented Jan 9, 2021

Hi! Awesome template, thanks for sharing!

I jut tried vitesse locally and while pnpm dev works just fine, pnpm build fails for me like so:

❯ pnpm build

> @ build /Users/ziga/development/ziga_vitesse
> cross-env NODE_ENV=production vite-ssg build --script async

[vite-ssg] Build for client...
building for production...
/Users/ziga/development/ziga_vitesse/node_modules/.pnpm/workbox-build@6.0.2/node_modules/workbox-build/build/lib/populate-sw-template.js:41
    throw new Error(errors['no-manifest-entries-or-runtime-caching']);
          ^

Error: Couldn't find configuration for either precaching or runtime caching. Please ensure that the various glob options are set to match one or more files, and/or configure the runtimeCaching option.
    at module.exports (/Users/ziga/development/ziga_vitesse/node_modules/.pnpm/workbox-build@6.0.2/node_modules/workbox-build/build/lib/populate-sw-template.js:41:11)
    at module.exports (/Users/ziga/development/ziga_vitesse/node_modules/.pnpm/workbox-build@6.0.2/node_modules/workbox-build/build/lib/write-sw-using-default-template.js:50:25)
    at async generateSW (/Users/ziga/development/ziga_vitesse/node_modules/.pnpm/workbox-build@6.0.2/node_modules/workbox-build/build/generate-sw.js:229:21)
 ERROR  Command failed with exit code 1.

I figured workbox is used by VitePWA and when I comment out VitePWA from vite.config.ts build succeeds.

@antfu
Copy link
Member

antfu commented Jan 9, 2021

Can't repro on the master branch. Can you share more info? Thanks.

@zigomir
Copy link
Author

zigomir commented Jan 9, 2021

Reproduction steps for me are:

npx degit antfu/vitesse my-vitesse-app
cd my-vitesse-app
pnpm i
pnpm build

Versions used

macOS 11.1
node --version
v15.5.1
pnpm --version
5.14.3

@SamuelAlev
Copy link

SamuelAlev commented Jan 9, 2021

Got the same error, except it works on macOS and fails on Github Actions (Ubuntu, Node 15).

@antfu
Copy link
Member

antfu commented Jan 9, 2021

Confirmed on Netlify build as well (not on my mac for some reasons). Probably a bug from the workbox upstream. Will have a look later.

@antfu antfu added bug Something isn't working and removed need reproduction labels Jan 9, 2021
@antfu antfu closed this as completed in 7d5a4b7 Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants