kevinmarrec / nuxt-pwa-module

⚠️ DEPRECATED ⚠️ Zero config PWA solution for Nuxt 3
MIT License
338 stars 32 forks source link

OneSignal #56

Closed ashbeats closed 1 year ago

ashbeats commented 1 year ago

Is there a way to to use '@nuxtjs/onesignal' with this pwa module?

If I add one signal to modules as such...

 modules: [
    '@nuxtjs/onesignal',
    "@kevinmarrec/nuxt-pwa",
  ],
  oneSignal: {
    init: {
      appId: "****",     
    },
  },
  pwa: {
    workbox: {
      enabled: true,
    },
    manifest: {
      name: "...",
      short_name: "...",
      lang: "en",
    },
  },

It triggers a build error (npm run dev).

Cannot start nuxt:  url.indexOf is not a function
  at isUrl (node_modules\@nuxtjs\pwa-utils\index.js:8:14)
  at getRouteParams (node_modules\@nuxtjs\pwa-utils\index.js:21:7)
  at Object.addOneSignal (node_modules\@nuxtjs\onesignal\index.js:28:26)
  at hook (node_modules\@nuxtjs\onesignal\index.js:13:18)

Stepping into that fn node_modules\@nuxtjs\pwa-utils\index.js:isUrl

function isUrl (url) {
  return url.indexOf('http') === 0 || url.indexOf('//') === 0
}

... reveals that url is undefined.

Is there something I'm doing wrong here, as the documentation here: https://pwa.nuxtjs.org/onesignal points to the old repo.

Thank you.

kevinmarrec commented 1 year ago

Hi @ashbeats this module does not have OneSignal support, yet.

kevinmarrec commented 1 year ago

As for Nuxt 2, OneSignal support for Nuxt 3 should be in a standalone module, and becomes then out of scope of the PWA module itself, therefore I'm unfortunately closing this issue here.