nuxt-community / pwa-module

Zero config PWA solution for Nuxt.js
https://pwa.nuxtjs.org
MIT License
1.25k stars 174 forks source link

Can't deploy to Vercel #470

Open ManusoGalan opened 3 years ago

ManusoGalan commented 3 years ago

Hello, it's my first time opening an issue, so I apologize in advance if I make any mistake defining the issue.

I've been building a small app and, even though the PWA module works on local, it's impossible to make it work when deploying to Vercel.

Currently I'm deploying to Vercel with the following configuration:

{
    "version": 2,
    "builds": [
        {
            "src": "nuxt.config.js",
            "use": "@nuxtjs/vercel-builder",
            "config": {
            "serverFiles": ["package.json"]
            }
        }
    ],
    "routes": [
        {
            "src": "/sw.js",
            "continue": true,
            "headers": {
                "Cache-Control": "public, max-age=0, must-revalidate",
                "Service-Worker-Allowed": "/"
            }
        }
    ],
    "env": {
        "npm_package_name": "i-luz",
        "npm_package_description": "Review Spain's energy prices",
        "npm_package_author_name": "Manuel Galán"
    },
    "build": {
        "env": {
            "npm_package_name": "i-luz",
            "npm_package_description": "Review Spain's energy prices",
            "npm_package_author_name": "Manuel Galán"
        }
    }
}

And in the nuxt.config.js, I've got the following regarding the PWA configuration:

pwa: {
    meta: {
      name: 'iLuz',
      lang: 'es',
      theme_color: '#fcd34d'
    },
    manifest: {
      name: 'iLuz',
      lang: 'es'
    }
  },

The main issue is that, when deplying locally, it works correctly... it generates a manifest.json with all the info. Meanwhile, when deploying it creates an empty manifest, so I don't know how to fix it.

The code is stored in this repo and is currently deployed here

Thanks!

jaribu commented 2 years ago

Hello, same issue here. You have find?