vite-pwa / astro

Zero-config PWA Integration for Astro
https://vite-pwa-org.netlify.app/frameworks/astro
MIT License
170 stars 5 forks source link

`@vite-pwa/astro@0.3.1` breaks the asset generator #44

Open MehrdadKhnzd opened 3 months ago

MehrdadKhnzd commented 3 months ago

Hi, After updating @vite-pwa/astro to 0.3.1 from 0.3.0, the asset generator doesn't work properly. It still generates the artifacts, but specifically, import { pwaAssetsHead } from 'virtual:pwa-assets/head' does not work as expected anymore, as the links array inside of it is empty so it can't be used to render any of the required links or the theme-color meta tag. Reverting it back to 0.3.0 fixed the problem for now.

userquin commented 3 months ago

what's the error? I cannot run the examples on my local, the pnpm monorepo requires adding the following to the Astro config file:

  vite: {
    server: {
      fs: {
        // Allow serving files from hoisted root node_modules
        allow: ['../..']
      }
    },
  },
userquin commented 3 months ago

Try adding sharp and sharp-ico to "resolutions" entry to your package.json file with 0.32.0 version: sharp 0.33.0+ change native libraries, or try installing the corresponding native packages.

"resolutions": { "sharp": "0.32.6" }