Firebase-app.js conflict with Dojo ?

Just starting out? Need help? Post your questions and find answers here.
skinkairewalker
Posts: 87
Joined: Tue Jun 14, 2016 7:17 pm

Firebase-app.js conflict with Dojo ?

Post by skinkairewalker »

hello everyone, im trying to wrap firebase fcm with my application, follow code below :

Code: Select all


Procedure AppendHead(content.s)
  Debug "head"
  !$("head").append(v_content);
EndProcedure

Procedure AppendBody(content.s)
  !$("body").append(v_content);
EndProcedure

Procedure AppendContent(component.i,content.s, Position = #PB_Ignore)
  GID = GadgetID(component)
  If Position <> #PB_Ignore
    ! $(".card:eq(" + v_position + ")").prepend(v_content);
  Else
    ! $(v_gid.div).append(v_content);
  EndIf
EndProcedure

Procedure FirebaseConfig()
  
    AppendBody("<!-- The core Firebase JS SDK is always required And must be listed first -->" +
             " <script src='https://www.gstatic.com/firebasejs/8.2.1/firebase-app.js'></script>" +
              
             " <!-- TODO: Add SDKs For Firebase products that you want To use" +
             "      https://firebase.google.com/docs/web/setup#available-libraries -->" +
             " <script src='https://www.gstatic.com/firebasejs/8.2.1/firebase-analytics.js'></script>" +
             " <script src='https://www.gstatic.com/firebasejs/8.2.1/firebase-messaging.js'></script>" + 

             " <script>" +
             "   // Your web app's Firebase configuration" +
             "   // For Firebase JS SDK v7.20.0 And later, measurementId is optional" +
             "   var firebaseConfig = {" +
             "     apiKey: 'AIzxxxXXXxxxXXXXXXXXXXxxxxxxxx'," +
             "     authDomain: 'appname.firebaseapp.com'," +
             "     projectId: 'appname'," +
             "     storageBucket: 'appname.appspot.com'," +
             "     messagingSenderId: '00000000000'," +
             "     appId: 'X:xXxxxxXXXXxxxXxxxxxX'," +
             "     measurementId: 'G-XXXXXXXXX'" +
             "   };" +
             "   // Initialize Firebase" +
             "   firebase.initializeApp(firebaseConfig);" +
             "   firebase.analytics();" +
             "   console.log('FCM = '+firebase.messaging()); "+
             " </script>")
             
EndProcedure  

Procedure Main()
  
  AppendBody("<div class='jumbotron'>"+
  "<h1 class='display-4'>Olá, mundo!</h1>"+
  "<p class='lead'>Este é um simples componente jumbotron para chamar mais atenção a um determinado conteúdo ou informação.</p>"+
  "<hr class='my-4'>"+
  "<p>Ele usa classes utilitárias para tipografia e espaçamento de conteúdo, dentro do maior container.</p>"+
  "<a class='btn btn-primary btn-lg' href='#' role='button'>Leia mais</a>"+
  "</div>") 
  
EndProcedure

  FirebaseConfig()

  ! $("<link rel='stylesheet' type='text/css'>").attr("href", "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css").appendTo("head");
  
  ! require(["https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"], function() {
   Main()
  ! });




chrome console problems :

Code: Select all

dojo.js:28 Error: multipleDefine
    at l (dojo.js:2)
    at Ja (dojo.js:24)
    at dojo.js:25
    at a (dojo.js:2)
    at Xa (dojo.js:25)
    at s (dojo.js:22)
    at HTMLScriptElement.<anonymous> (dojo.js:27)
(anonymous) @ dojo.js:28
DevTools failed to load SourceMap: Could not load content for http://localhost/fcm/libs/dojo/dojo.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for http://localhost/fcm/libs/dojo/nls/dojo_pt-br.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
screenshot of problem :
url : https://prnt.sc/weeno6

is there any way to fix this problem and enable firebase in my application?