Activities

danieltamas

danieltamas posted a new bug report

pwa-module •

bug ignoreURLParametersMatching not regex in cacheOptions

Version

v3.0.0-beta.19

Reproduction link

https://codesandbox.io/s/cranky-grothendieck-y4kyh

Steps to reproduce

in nuxt.config.js edit the pwa to contain ignoreURLParametersMatching ( this will be added at the option to precaching )

pwa: {
        cacheOptions: {
            cacheId: 'test',
            directoryIndex: '/',
            revision: timestamp,
            ignoreURLParametersMatching: [/.*/]
        },
}

npm run build

What is expected ?

ignoreURLParametersMatching: [/.*/]

What is actually happening?

ignoreURLParametersMatching: [{}]

Additional comments?

This breaks the preCache functionality when query strings exist in the requested file, throwing a 404 error from the service worker.

designy

designy posted a new question

pwa-module •

Why documentation say sw.* should place in gitignore?

Hi,
when you run yarn build in your project, a sw.js file generated in the static directory and in deployment environment browser need sw.js in the root of your domain to register it, but in nuxtjs/pwa Get Started documentation said that we should write sw.* to gitignore to prevent track sw.js in git.

lupas

lupas posted a new feature request

pwa-module •

idea Option for dev=false to still load additional SW's from importScripts()

What problem does this feature solve?

When dev === false, not only the workbox module, but also other additional service-workers loaded via importScripts are not loaded.

In my case I am fine with disabling workbox in development, but I would still want all (or some of) my other service workers to be loaded in development mode.

What does the proposed changes look like?

Something like this in nuxt.config.js:

// OLD
importScripts: [
  '/my-other-sw.js',
],

// PROPOSED
importScripts: [
  {
    src: '/my-other-sw.js',
    force: true // also load in dev when dev=false
  }
],

If that makes sense I'm happy to do a PR for it.

lpender

lpender posted a new question

pwa-module •

Getting Started documentation doesn't seem to get me started

First, thank you for building this, I'm sure it's amazing.

I followed the "Getting Started" documentation here: https://pwa.nuxtjs.org/setup.html

It ends with:

"Continue reading docs for detailed info."

It doesn't even get me to a "Hello World" page.

The next item at the top, "Workbox Module" seems to delve straight into arcane elements of the API.

It would be great if the Getting Started got me at least to a "Hello World"

patrioticcow

patrioticcow posted a new question

pwa-module •

Run Nuxt PWA as a dev-dependency

Any way to run this as a dev depencency?

The bundle size and download size are.. huge..

490.6kB minified

3.11s over 3G

source: https://bundlephobia.com/[email protected]/[email protected]

patrioticcow

patrioticcow posted a new question

pwa-module •

Run Nuxt PWA as a dev-dependency

Any way to run this as a dev depencency?

The bundle size and download size are.. huge..

490.6kB minified

3.11s over 3G

source: https://bundlephobia.com/[email protected]/[email protected]

SarasArya

SarasArya posted a new question

pwa-module •

The OneSignal integration with the custom link doesn't work in SPA

Hi Team,

So say I am on page X and one signal is loaded when I change route and go to a specific page where the custom link is supposed to be, I don't see the button until I refresh the page.
Once I refresh the button starts to appear… If I call OneSignal.init it fails with a warning saying
OneSignal: The OneSignal web SDK can only be initialized once. Extra initializations are ignored
This is a common problem with SPAs how do we resolve this?

Heziode

Heziode posted a new question

pwa-module •

How can I manage multilingual app with WPA with the manifest ?

Hi,

I wonder how we can handle multilingual in the manifest file ?

Because manifest should be something like that:

pwa: {
  manifest: {
    name: 'My Awesome App',
    lang: 'en'
  }
}

According to the W3C spec, lang shall be a string, so… how can a manage a multilingual application ?
Especially if it is a static site hosted on GitHub ?

Guito

Guito posted a new bug report

pwa-module •

bug It's not possible not to have workbox.setConfig in sw.js

Version

v3.0.0-beta.19

Reproduction link

https://jsfiddle.net/zcrtmdsx/1/

Steps to reproduce

When using

pwa: {
  workbox: {
            importScripts: ["my-script.js"],
            dev: true,
            config: undefined
        }
}

The compilation crashes because config is undefined:

if (options.config.debug === undefined) {
    // Debug field is by default set to true for localhost domain which is not always ideal
    options.config.debug = options.dev || this.options.dev
  }

And it's the only way to not have it added:

<% if (options.config) {%>
// Set workbox config
workbox.setConfig(<%= JSON.stringify(options.config, null, 2) %>)
<% } %>

What is expected ?

To be able to not have the setConfig in sw.js so we can use workbox in importScripts

What is actually happening?

There is a compilation error:

 FATAL  Cannot read property 'debug' of undefined                                                                     12:50:35

  at ModuleContainer.getOptions (node_modules\@nuxtjs\pwa\lib\workbox\options.js:88:22)
  at nuxt.hook (node_modules\@nuxtjs\pwa\lib\workbox\module.js:9:32)
  at fn (node_modules\hable\lib\hookable.js:50:45)
  at promise.then.previous (node_modules\hable\lib\utils.js:15:67)
  at process._tickCallback (internal/process/next_tick.js:68:7)

If I set a value for config, the setConfig is added and I get the following error because I am using workbox in 'my-script.js':

Config must be set before accessing workbox.* modules
cliffordh

cliffordh posted a new question

pwa-module •

Default PWA url?

How can I set the default route for my PWA? I want users to launch the PWA into a subdirectory, not the root of the site.

lroy83

lroy83 posted a new question

pwa-module •

Dynamically change meta content

Hi,

I managed to set the pwa.meta content in nuxt.config.js and its working.
but there is one page that i want to change the content of the title and the description with the head() method.

it doesn't seem to work.

this is my nuxt.config.js:

pwa: {
    meta: {
      description: 'pwa.meta description',
      ogTitle: 'pwa.meta ogTitlen',
      ogSiteName: 'pwa.meta ogSiteName'
    }
  }

this is my head method:

head () {
    return {
      title: 'head title',
      meta: [
        { hid: 'og:title', name: 'og:title', content: "head.meta og:title" },
        { hid: 'description', name: 'description', content: 'head.meta description' },
        { hid: 'og:site_name', name: 'og:site_name', content: 'head.meta og:site_name' }
      ]
    }
  }
}

when i inspect the page i can see the meta headers that the head() method added:
Screen Shot 2020-01-22 at 10.51.39.png

but with open graph check tools i get only the content that was defined in the nuxt.config.js file.

Screen Shot 2020-01-22 at 10.36.52.png

Is it possible?
Am i missing something?

Thanks!

squareborg

squareborg posted a new question

pwa-module •

Workbox - Offline Uncaught (in promise) ChunkLoadError: Loading chunk 21 failed.

Using the nuxt app offline, the index page loads fine, but when navigating to our user profile section I get

Uncaught (in promise) ChunkLoadError: Loading chunk 21 failed.

This is indeed the chunk that is required for the user profile.

I'm using the beta "@nuxtjs/pwa": "3.0.0-beta.19",

I tried adding ['/user'] to the preCaching array but this has not fixed the issue.

Any ideas? Thanks

jbty

jbty posted a new question

pwa-module •

How to using preCaching option ?

How to using preCaching option ?

In the doc there is no example for use preCaching option.

Can someone explain me, how to pre-cache my app when registering service worker ?

buglavecz

buglavecz posted a new bug report

pwa-module •

bug $OneSignal sometimes works in a PROD environment, sometimes not, in DEV enviroment works fine

Version

v3.0.0-beta.19

Reproduction link

https://github.com/nuxt-community/pwa-module

Steps to reproduce

I was create a trusted https on localhost for testing, there working fine with OneSignal.
But, in production environment sometimes working.

If not works, then I got this error, when refresh browser:

one-signal-error.jpg

I don't understand what is wrong?


I call OneSignal in mounted() hook in app layout.

this.$OneSignal.push(() => {

   this.$OneSignal.showNativePrompt();


    this.$OneSignal.isPushNotificationsEnabled((isEnabled) => {
    if (isEnabled) {
      console.log('Push notifications are enabled!')
    } else {
      console.log('Push notifications are not enabled yet.')
    }
  })
});

If I refresh many times the browser, then I got this (only in production):

one-signal-error-2.jpg

What is expected ?

Every page refresh show native prompt to user.

What is actually happening?

Sometimes show, sometimes not showing native prompt.

Additional comments?

I don't understand, why works on DEV env, and why not in PROD env. :-(

Please help!!!

watsab

watsab posted a new question

pwa-module •

Offline assets not working

Hi !

I'm facing an issue that I don't know how to solve: I'm working on a pwa application that must work offline. To ensure it works fine when offline I'm precaching assets using the offlineAssets option, but they do not seem to be precached as expected. Inded if they have not been explored before going offline I have a "net::ERRINTERNETDISCONNECTED".
Below is an extract of my nuxt.config.js with workbox conf:

workbox: {
dev: process.env.ENV === 'development',
offlineAnalytics: process.env.ENV !== 'development',
offlineAssets: [
'assets/placeholder/accessories.svg',
'assets/placeholder/document.svg',
'assets/placeholder/round.svg',
'assets/placeholder/square.svg',
'assets/placeholder/telecom.svg',
'assets/fonts/opensans/OpenSans-Bold.ttf',
'assets/fonts/opensans/OpenSans-Bold.woff',
'assets/fonts/opensans/OpenSans-Bold.woff2',
]
}

Do you have an idea of why they are not precached ?

BTW, I'm using nuxt/pwa with version 3.0.0-beta.19

Thanks !

boukadam

boukadam posted a new question

pwa-module •

OneSignal cannot register sw when deploying on Google App Engin

First of all, is it a good pratice to deploy a nuxt app under Google App Engine? I use cloudbuild to deploy when pushing on git repo :

App.yml
runtime: nodejs10
instanceclass: F2 envvariables:
HOST: '0.0.0.0'
NODE_ENV: 'production'

cloudbuild.yml
steps:

  • id: 'Install npx'
    name: 'gcr.io/cloud-builders/npm'
    args: ['install', 'npx']
  • id: 'Install dependencies'
    name: 'gcr.io/cloud-builders/npm'
    args: ['install']
  • id: 'Build app'
    name: 'gcr.io/cloud-builders/npm'
    args: ['run', 'generate']
  • id: 'Deploy app'
    name: 'gcr.io/cloud-builders/gcloud'
    args: ['app', 'deploy', 'app.yml']

This deploy the nuxt app in a nodejs environment. On startup, OneSignal try to generate sw on fly and got this error :

A 2019-12-27T19:00:23.915229Z ╭───────────────────────────────────────────────────────────────────────────────────╮
A 2019-12-27T19:00:23.915241Z │ │
A 2019-12-27T19:00:23.915253Z │ ✖ Nuxt Fatal Error │
A 2019-12-27T19:00:23.915294Z │ │
A 2019-12-27T19:00:23.915311Z │ Error: EROFS: read-only file system, open '/srv/static/OneSignalSDKWorker.js' │
A 2019-12-27T19:00:23.915320Z │ │
A 2019-12-27T19:00:23.915334Z ╰───────────────────────────────────────────────────────────────────────────────────╯

I understand that fs under App Engine is ready only, so it means that is impossible to deploy a nuxt app using OneSignal this way ?

Thanks.

liyasthomas

liyasthomas posted a new feature request

pwa-module •

idea No maskable icon support

What problem does this feature solve?

Maskable icons support for PWA is gaining pace in most browsers and still it is not supported in Nuxt PWA module

What does the proposed changes look like?

On nuxt.config.js adding purpose field to PWA images will make icons compatible for maskable icons.

Viruss98

Viruss98 posted a new question

pwa-module •

I have an issue when i have new data from api but workbox not replace old data from cache data with new data

I am using @nuxtjs/pwa , the first time running in website it look good but when i add a data into database (in page 1), and back to another page(page 2), and then i go back to the page 1, the data does not have the new data i added , but if i Ctrl + f5 the data i added is show, i don't know what the issue is ? I am using nuxt ^2.0.0 mode ssr, "@nuxtjs/pwa: ^3.0.0-0". Thanks you very much

Viruss98

Viruss98 posted a new question

pwa-module •

I have an issue when i have new data from api but workbox not replace old data from cache data

I am using @nuxtjs/pwa , the first time running in website it look good but when i add a data into database (in page 1), and back to another page(page 2), and then i go back to the page 1, the data does not have the new data i added , but if i Ctrl + f5 the data i added is show, i don't know what the issue is ? I am using nuxt ^2.0.0 mode ssr, "@nuxtjs/pwa: ^3.0.0-0". Thanks you very much

binzcodes

binzcodes posted a new question

pwa-module •

Unsure of format for ogHost, ogUrl

Hi, I'm struggling to figure out the correct format for ogHost and ogUrl
Should it be 'site.tld', 'https://www.site.tld' or an any be used?

I'm running with the former right now and seem to have a working PWA - but my CI gives me a URL variable in the latter format and wondering if I can switch to using that without issue.

I can't find anything in the docs or any examples in the wider internet.

If there's a general resource out there please point me in the right direction too.

Thanks!