ERROR Failed to compile with 1 error 1:17:23 AM
This dependency was not found:
* https://www.gstatic.com/firebasejs/9.6.3/firebase-app.js in ./node_modules/firebase/firebase-messaging.js
To install it, you can run: npm install --save https://www.gstatic.com/firebasejs/9.6.3/firebase-app.js
Hello,
Is it necessary to put firebase.js in a specific folder on step 3?
Can you give me the advice to tell me should put this file (firebase.js) in which folder?
Hey,
I guess you are trying to send the request from the service worker and not from the app itself, as far as I know you can't access axios inside service workers - but you can use fetch instead:
Thanks a lot!
I could be able to complete all the steps successfully following this article.
I am getting an error
Hi,
I'm getting this too - on build.
Do you remember how you fixed it - assuming you did :)
Thanks
This is due to a firebase npm package version 9 bug.
Solution: steps-
Are you trying to install firebase npm package? If you do, then what is the version ?
How can i get access to the generated "currentToken" in vue ?
Hey,
You can call the
getToken()function again - you will get the registered token.Hello,
Is it necessary to put firebase.js in a specific folder on step 3?
Can you give me the advice to tell me should put this file (firebase.js) in which folder?
Hey, you can place the firebase.js file where-ever you want, you can even place the content of the file inside main.js and delete firebase.js.
Hi Fima!
How to post currentToken to some API by axios?
I cannot use import statement outside vue module!
Hey,
I guess you are trying to send the request from the service worker and not from the app itself, as far as I know you can't access
axiosinside service workers - but you can usefetchinstead:Thanks a lot!
register(
${process.env.BASE_URL}firebase-messaging-sw.js)Step3, firebase.js code throw an error like this, why?
How to subscribe to specific topics with this approach bro? Thanks in advance.
i am getting this error when i get vapidKey
i used step 3
it is necessary to import something to use messaging.getToken in Step 4 ?
Yes, you need to import firebaseMessaging from the src/firebase.js file. Then you can use it like firebaseMessaging.getToken()