Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Firebase messaging from bubble

I’ve got a simple HTML element in Bubble.io that I’m trying to run javascript from.

Here’s the error:

Uncaught Error: Service messaging is not available
    at Provider.getImmediate (provider.ts:130:15)
    at getMessagingInWindow (api.ts:64:61)
    at about:blank:35:19

and here’s the pseudocode:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<script type="importmap">
{
    "imports": {
        "firebase/app": "https://www.gstatic.com/firebasejs/9.6.6/firebase-app.js",
        "firebase/messaging": "https://www.gstatic.com/firebasejs/9.6.9/firebase-messaging.js"
    }
}
</script>
  <script type="module">
   import { initializeApp } from 'firebase/app';
   import { getMessaging } from 'firebase/messaging';
   const firebaseConfig = {
   //...my config
   };

   // Initialize Firebase
   const app = initializeApp(firebaseConfig);
   const messaging = getMessaging(app); // ERROR HERE
   console.log(messaging)
</script>


Has anyone solved this? How can I run the push notifications script from a bubble page?

>Solution :

The versions of your Firebase SDK imports are mismatched. Make sure they are always the same version. It’s also a good idea to make sure you’re on the latest.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading