Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PWA + SPA not workting together in npm run dev #219

@mlem

Description

@mlem

Version

v3.0.0-beta.16

Reproduction link

http://i-dont-have-an-url-yet.com

Steps to reproduce

Generate a new nuxtJS app: npx create-nuxt-app
Add PWA support: npm i @nuxtjs/pwa and ['@nuxtjs/pwa'], to the config file as outline in https://pwa.nuxtjs.org/setup.html
The config nuxt.config.js looks like this in the end:

module.exports = {
  mode: 'spa',
  modules: [
    '@nuxtjs/pwa',
  ],
  build: {
    /*
    ** Run ESLint on save
    */
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  },
  icon: {
    // Icon options
  },
  manifest: {
    lang: 'de',
    name: "adsf",
    short_name: "adsf",
  },
  workbox: {
    // Workbox options
  }

Add a /static/icon.png with some logo
Start app: npm run dev
Visit web hosting endpoint and open Chrome developer tools
Navigate to the "Application" tab to see favicons missing

What is expected ?

I would expect to see my logo as favicon. I would also expect running an audit on the "Audits" tab to return a identification of the app as a PWA.

What is actually happening?

Chrome doesn't display the favicons, because they are not loaded with the site.

Additional comments?

When I generate the sources and run it locally, it works correctly.

npm run generate 
cd dist && python -m http.server 8080

It seems, it's just an npm run dev issue.

This bug report is available on Nuxt community (#c160)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions