Firebase Push notification not working in quasar framework n Vue.js
-
I am using firebase to send push notification inside quasar framework. Its working fine locally.
But when we deploy code to dev server .
Then it gives error:-Failed to register a ServiceWorker: A bad HTTP res…code (404) was received when fetching the script.Because after building quasar app it generate its own service-worker.js file when we want to add code or add our own service woker then it dosenot work.
1.Please tell me how to use our own firease-messaging-sw.js in place of quasar generated service-worker.js.
Becouse for firebase push notification search service worker file with name of " firease-messaging-sw.js"
2.Even i add my code to service-worker.js then also it dont reflect in code.Thanks in advance
-
Hi, I’m having a similar problem, I can’t find a way to use firebase-messaging-sw.js instead of custom-service-worker.js (or additionally). Did you solve the problem? Thanks!
-
/node_modules/@firebase/messaging/dist/index.cjs.js
You will find index.esm.js, index.cjs.js.map and index.esm.js.map also at above location.Total 4 files.
var DEFAULT_SW_PATH = ‘/service-worker.js’;
var DEFAULT_SW_SCOPE = ‘/’;Do above two changes wherever you find DEFAULT_SW_PATH and DEFAULT_SW_SCOPE
then build again, everything will work fine. -
So, the only way is modifying the firebase node_module?
How can you handle that in different environments and buildings, nodes modules are installed each time a build is made with continuos integration strategy. -
@cata-orellana said in Firebase Push notification not working in quasar framework n Vue.js:
So, the only way is modifying the firebase node_module?
How can you handle that in different environments and buildings, nodes modules are installed each time a build is made with continuos integration strategy.I would also like to know the solution in said case.
-