I can totally relate! Don’t get me wrong I’m very thankful to the universe that I am employed but my mental health feels increasingly challenged lately.
Literally what I went through as well just trying to use a distance between two points module... I wish I was a cool front end kid.... but this type of experience is exactly what turns me off from front end dev
I wish that type of experience would be uncommon, rare, exceptions... But in my perspective is the real true state of front-end today. Everything is broken from a outside perspective, so much changes happened that for me learning the overall Common Lisp specification (from 1000+ pages) it's more easy to do JS dev stuff on browser.
npm i pythag
npm i complex-sqrt
// then
var pythag = require('pythag');
var sqrtrt = (z) => require('complex-sqrt')(z,0);
let x = 3
const y = 4
var result = sqrtrt(pythag(x, y))