Firebase realtime database works fine in the old offline P5 editor. But when I use the same code in the new online editor, the variable firebase is not recognized:
*"Uncaught ReferenceError: firebase is not defined (sketch: line 12)"*
The code is directly from The Coding Train 9.2 “Firebase: Saving Data - Programming with Text” with the currently recommended Firebase source link added to the index:
<script src="https://www.gstatic.com/firebasejs/6.0.2/firebase-app.js"></script>
and with account config removed from sketch.js:
function setup() {
console.log("Setup");
var firebaseConfig = {
apiKey: "...",
authDomain: "...",
databaseURL: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "....",
appId: "..."
};
firebase.initializeApp(firebaseConfig);
console.log(firebase);
}
Again, it works fine in the old offline P5 editor but not in the new online one. Any suggestions appreciated so the online editor can be used to replace the old offline editor.
Thanks in advance.