Thursday 14 January 2021

TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_4__.auth is not a function

 So I got this issue while following a tutorial on how to set Authentication on a Firebase + Vue project here https://www.youtube.com/watch?v=XtbYBoKb2zY

On the section about setting up the register page.  

ERROR

Setting up the Register page as Following is giving me an error.

1 2 3 4 5 6 7 8 9 10 11 12 13 export default { methods: { async pressed(){ try { const user = firebase.auth().createUserWithEmailAndPassword(this.email) console.log(user) this.$router.replace({name: "secret"}) } catch(err){ console.log(err) } } },
1 2 3 4 5 6 7 8 9 10 11 12 13 # ERROR TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_4__.auth is not a function at _callee$ (Register.vue?0103:24) at tryCatch (runtime.js?96cf:63) at Generator.invoke [as _invoke] (runtime.js?96cf:293) at Generator.eval [as next] (runtime.js?96cf:118) at asyncGeneratorStep (asyncToGenerator.js?1da1:3) at _next (asyncToGenerator.js?1da1:25) at eval (asyncToGenerator.js?1da1:32) at new Promise (<anonymous>) at eval (asyncToGenerator.js?1da1:21) at VueComponent.pressed (Register.vue?0103:22)


The issue was actually in my main.js where I had

1 import firebase from "firebase/app"

I changed this to

1 import firebase from "firebase/app"

and it worked. :)

Tuesday 5 January 2021

Improving my PythonAnywhere Deployment

At the moment I have a disconnected Deployment process.  Where the site I’m looking at locally does not reflect what is on live.

So let’s make a note of some techniques that could improve my flow. 


A staging site - although my hosting package doesn’t support having a staging area but I could use another PythonAnywhere free account as a staging area.

Using Fabric to automate deployment.

Some reading material on this.

http://www.jeffknupp.com/blog/2013/12/18/starting-a-django-16-project-the-right-way/

https://www.pythonanywhere.com/forums/topic/1067/


The information in the blog above that I’m interested in is.

  1. Automated deployment and testing (using Fabric)
  2. Automatic database migrations (using South)



Also I found this youtube video on deploying on PythonAnywhere which looks pretty good. 


https://www.youtube.com/watch?v=Y4c4ickks2A - this is good for deployment but doesn’t have anything on automated future deployment. 


Use cloud flare for the domain and point the name record