Showing posts with label webdev. Show all posts
Showing posts with label webdev. Show all posts

form.submit() is not a function (JavaScript)

Recently, I tried sending a form using JS. I was sure I didn't make typos and errors in my code. Turns out you can't set the name attribute of an input submit and use the JS function submit() at the same time. JS tries to access submit, finds the button and thinks: "Weird, this isn't a function". So, make sure you didn't set the name attribute of any input to submit. It can conflict with the JS function.



Phoenix Framework doesn't work on Arch Linux due to node-sass

While trying to setup a chat app on Arch Linux using Phoenix Framework I ran into a lot of nodejs related errors. First of all, make sure you're using nodejs 14 or maybe 15. Everything above is absolute hell. I recommend using nvm.

I still got a lot of errors using node-sass. It prevented me from using websockets by crashing the building process. Turns out you can just replace node-sass with sass in package.json

Just remove this line:

"node-sass": "xx.xx.xx"

And replace it with:

"sass": "^1.22.10"

Ta da! All problems fixed. I have no idea why the guys over at Phoenix Framework don't just ship this as the default!

Sources: