-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$OneSignal sometimes works in a PROD environment, sometimes not, in DEV enviroment works fine #1
Comments
@pi0 can you help me? Thanks. |
In PROD enviroment: In DEV environment all working fine. |
Has same issue |
I appear to have the same/similar issue. Everything is fine on dev environment. Building for prod, OneSignal behaves correctly until notifications have been enabled. Push notifications then work until page is refreshed. All subsequent page loads after that generates the following error OP mentioned, and notifications no longer work until clearing site data and repeating the notifications prompt process:
My config:
|
anyone? |
Facing the same issue |
After experiencing the same issue I started digging. |
Problem found. To fix this '@nuxtjs/onesignal' imports sw.js (the sw created by Then it tries to set our pwa sw path to OneSignalSDKWorker.js using This is why at first install we always get sw.js first, but OneSignalSDK.js overwrite this under the hood and on refresh our app sees it has a different service worker and overwrites it again. I'll try to make a pull request but while it gets accepted feel free to fix this manually by addding |
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:
I don't understand what is wrong?
I call OneSignal in mounted() hook in app layout.
If I refresh many times the browser, then I got this (only in production):
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!!!
The text was updated successfully, but these errors were encountered: