Activities

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!

Mohitpokra

Mohitpokra posted a new feature request

pwa-module •

idea In case of slow internet use cached data and after getting data from internet replace cached data with it.

What problem does this feature solve?

In case of slow internet app takes a lot of time to load the page, We can show cached data and whenever data form internet is available we can replace cached data with new one.

Mohitpokra

Mohitpokra posted a new question

pwa-module •

Don't fetch data from internet if cached data is available.

Every time when I visits a page it fetches data again from the internet, is there any way by which we can check first in cache if cache data is not available then we can fetch it form internet.

nachogarcia

nachogarcia posted a new question

pwa-module •

Environment Variables

I'm wondering if there is a way of passing environment variables to this module in runtime rather than in build time, so I can have the same build for different environments and just change the env var (I put just the build and needed node_modules in the docker image).

Do you think is worth to put something about this in the docs? After your response I'd be able to.

Mohitpokra

Mohitpokra posted a new question

pwa-module •

Don't fetch data from internet if cached data is available.

Every time when I visits a page it fetches data again from the internet, is there any way by which we can check first in cache if cache data is not available then we can fetch it form internet.

OsirisFrik

OsirisFrik posted a new bug report

pwa-module •

bug OneSignal don't pass init options

Version

v3.0.0-beta.16

Reproduction link

https://codesandbox.io/s/onesignal-6b1ew

Steps to reproduce

Set OneSignal settings and check in console

What is expected ?

Pass my settings to OneSignal config

What is actually happening?

Only pass AppId to the settings

burn4live

burn4live posted a new question

pwa-module •

window.OneSignal already defined as 'function'!

window.OneSignal already defined as 'function'!
Please make sure to define as 'window.OneSignal = window.OneSignal || [];' class Gt{static setDefaultNotificationUrl(e){return zt(this,void 0,void 0,function*(){if(!Ht.isValidUrl(e,{allowNull:!0}))throw new InvalidArgumentError.a("url",InvalidArgumentError.b.Malformed);yield Obje…

What is wrong here why do i get this error?

modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/auth',
'@nuxtjs/onesignal',
'@nuxtjs/pwa',
'nuxt-material-design-icons'
],
oneSignal: {
init: {
appId: 'MYAPPID',
allowLocalhostAsSecureOrigin: true,
welcomeNotification: {
disable: false
}
}
},

svale

svale posted a new feature request

pwa-module •

idea The `name`-attribute be removed when constructing open graph tags in the Meta module

What problem does this feature solve?

Thank you for providing a great plugin and module!

Currently the Meta module creates open graph meta tags with a both a name and property-attribute. The presence fo the name-attrib triggers "Warnings That Should Be Fixed" by the Facebook Sharing Debugger:

The following meta tags are specified using 'name' instead of 'property' and will be ignored unless specified using the 'property' key: og:type, og:title, og:site_name, og:description

(my emphasis on "will be ignored")

What does the proposed changes look like?

I suggest removing the name-attribute and go with property only.

I see that the issue has been commented on before, but the debugger feedback indicates that using the name-key might in fact not be valid. Also the Open Graph protocol specifies the use of property and content attributes for markup, and services like Twitter (which use name and content) documents supporting just property.

Removing ´name´ from og:-tags should have no detrimental effects, but ensure or improve propper parsing from e.g. Facebook.

Sidenote: A similar concern raised elsewhere (at Grav) was concluded by removing the name-attib (though with an unnecessary exception for twitter).

Would a PR for this modification be considered?

Thanks!

LeCoupa

LeCoupa posted a new question

pwa-module •

Disable add to home screen

Is there a way to disable the add to home screen banner to appear on mobile? I might be blind, but I can't find the options for this here.

svale

svale posted a new question

pwa-module •

Could attributes for og:-meta tags be adjusted? [moved]

[Moved to feature requests where it belonged]

just-tom

just-tom posted a new question

pwa-module •

Background sync

Hi guys,

I need to implement a background sync function with work box. Unfortunately I can’t find any resources on how to do this with Nuxt PWAs implementation.

I have read about using importScripts but this fails with an error saying workbox Config needs to be set to be able to use it.

I also tried to set the swURL to a custom file in static/ and then used importScript() to include the generated sw.js as suggested in other issues but still no luck.

Any suggestions on how to get an additional sw working to include background sync, would be much appreciated,

Thanks

P4sca1

P4sca1 resolved the question #c177

pwa-module •

OneSignal.push works but $nuxt.$OneSignal.push does not
P4sca1

P4sca1 posted a new bug report

pwa-module •

bug OneSignal.push works but $nuxt.$OneSignal.push does not

Version

v3.0.0-beta.19

Reproduction link

https://staging.ips-hosting.com

Steps to reproduce

I am having a problem in my production deploy where the callback provided to $nuxt.OneSignal.push() is never called.
Everything works fine in dev.

Environment:

ubuntu: 18.04
node: 12.13
nuxt: 2.10.2
@nuxtjs/pwa: 3.0.0-beta.19
mode: universal

Here are the results of some tests I did in the browser console:

$nuxt.$OneSignal.push(() => { console.log("test") })
undefined
OneSignal.push(() => { console.log("test") })
VM125:1 test
undefined

As you can see $nuxt.$OneSignal.push is not working but OneSignal.push is.

I provided the url to my staging deployment where you can test yourself.

What is expected ?

The callback provided to $nuxt.$OneSignal.push should also be called in production.

What is actually happening?

OneSignal.push works but $nuxt.$OneSignal.push does not.

Additional comments?

If that helps, here is my Dockerfile:

# Base
FROM node:12.13-alpine as base

# Required build args, mapped to environment variables.
# Using a base image allows us to share those environment variables between the builder and the final image.
# This makes sense, because most environment variables are required both during build and during runtime.
ARG URL
ENV URL=$URL
ARG API_URL
ENV API_URL=$API_URL
ARG GA_TRACKING_ID
ENV GA_TRACKING_ID=$GA_TRACKING_ID
ARG STRIPE_API_KEY
ENV STRIPE_API_KEY=$STRIPE_API_KEY
ARG PAYPAL_CLIENT_ID
ENV PAYPAL_CLIENT_ID=$PAYPAL_CLIENT_ID
ARG ONESIGNAL_APP_ID
ENV ONESIGNAL_APP_ID=$ONESIGNAL_APP_ID

# Builder
FROM base as builder

WORKDIR /home/node/app

COPY .npmrc .
COPY package*.json ./
RUN npm install

COPY . .
RUN npm run build && npm prune --production

# Final image
FROM base

RUN apk add --update --no-cache curl

USER node

RUN mkdir /home/node/app
WORKDIR /home/node/app

ENV NODE_ENV=production

EXPOSE 3000/tcp

COPY --from=builder --chown=node:node /home/node/app/.nuxt ./.nuxt
COPY --from=builder --chown=node:node /home/node/app/server-middleware ./server-middleware
COPY --from=builder --chown=node:node /home/node/app/static ./static
COPY --from=builder --chown=node:node /home/node/app/workbox ./workbox
COPY --from=builder --chown=node:node /home/node/app/nuxt.config.js .
COPY --from=builder --chown=node:node /home/node/app/package.json .
COPY --from=builder --chown=node:node /home/node/app/node_modules ./node_modules
COPY --from=builder --chown=node:node /home/node/app/healthcheck.sh ./healthcheck.sh

HEALTHCHECK \
  --interval=15s \
  --timeout=3s \
  --retries=3 \
  CMD /bin/sh /home/node/app/healthcheck.sh

CMD ["npm", "start"]

OneSignalSDK* is added to my .dockerignore.

P4sca1

P4sca1 posted a new question

pwa-module •

OneSignal.push works but $nuxt.$OneSignal.push does not

I am having a problem in my production deploy where the callback provided to $nuxt.OneSignal.push() is never called.
Everything works fine in dev.

Environment:

ubuntu: 18.04
node: 12.13
nuxt: 2.10.2
@nuxtjs/pwa: 3.0.0-beta.19
mode: universal

Here are the results of some tests I did in the browser console:

$nuxt.$OneSignal.push(() => { console.log("test") })
undefined
OneSignal.push(() => { console.log("test") })
VM125:1 test
undefined

As you can see $nuxt.$OneSignal.push is not working but OneSignal.push is.

If that helps, here is my Dockerfile:

# Base
FROM node:12.13-alpine as base

# Required build args, mapped to environment variables.
# Using a base image allows us to share those environment variables between the builder and the final image.
# This makes sense, because most environment variables are required both during build and during runtime.
ARG URL
ENV URL=$URL
ARG API_URL
ENV API_URL=$API_URL
ARG GA_TRACKING_ID
ENV GA_TRACKING_ID=$GA_TRACKING_ID
ARG STRIPE_API_KEY
ENV STRIPE_API_KEY=$STRIPE_API_KEY
ARG PAYPAL_CLIENT_ID
ENV PAYPAL_CLIENT_ID=$PAYPAL_CLIENT_ID
ARG ONESIGNAL_APP_ID
ENV ONESIGNAL_APP_ID=$ONESIGNAL_APP_ID

# Builder
FROM base as builder

WORKDIR /home/node/app

COPY .npmrc .
COPY package*.json ./
RUN npm install

COPY . .
RUN npm run build && npm prune --production

# Final image
FROM base

RUN apk add --update --no-cache curl

USER node

RUN mkdir /home/node/app
WORKDIR /home/node/app

ENV NODE_ENV=production

EXPOSE 3000/tcp

COPY --from=builder --chown=node:node /home/node/app/.nuxt ./.nuxt
COPY --from=builder --chown=node:node /home/node/app/server-middleware ./server-middleware
COPY --from=builder --chown=node:node /home/node/app/static ./static
COPY --from=builder --chown=node:node /home/node/app/workbox ./workbox
COPY --from=builder --chown=node:node /home/node/app/nuxt.config.js .
COPY --from=builder --chown=node:node /home/node/app/package.json .
COPY --from=builder --chown=node:node /home/node/app/node_modules ./node_modules
COPY --from=builder --chown=node:node /home/node/app/healthcheck.sh ./healthcheck.sh

HEALTHCHECK \
  --interval=15s \
  --timeout=3s \
  --retries=3 \
  CMD /bin/sh /home/node/app/healthcheck.sh

CMD ["npm", "start"]

OneSignalSDK* is added to my .dockerignore.

Anybody got an idea?

azulkipli

azulkipli posted a new bug report

pwa-module •

bug PWA icons option iconFileName

Version

v3.0.0-beta.19

Reproduction link

https://codesandbox.io/s/nuxt-pwa-icon-custom-vi4dz

Steps to reproduce

clone the codesanbox,
install node dependencies with executing yarn
execute yarn generate:staging to build Nuxt prerender SPA

What is expected ?

Based on this documentation the pwa module should be generate icon based on filename

https://pwa.nuxtjs.org/modules/icon.html#options

but it just generated default icon.png

What is actually happening?

I try the option with using different file name icon_dev.png if NODE_ENV=staging in the iconFileName

Nuxt with pwa module just generate default icon.png even I wrote different icon file name.

Pijuli

Pijuli posted a new question

pwa-module •

Is cmty.app issue getting any attention?

I see tons of questions with no answers at all. Not complaining about mine at all.
What's the point on moving the issues there? I only see it as a way of not tracking them here, where they would have more visibility.

Pijuli

Pijuli resolved the question #c172

pwa-module •

A2HS (Add to home screen) documentation

Working as soon as it's deployed on https.

frederic117

frederic117 posted a new question

pwa-module •

Push.js as a pwa module

Is there a way to include push.js in pwa module?