When I was 23, I used to be totally comfortable cranking out Javascript UIs like there was no tomorrow. These days I'm approaching 33 and I can barely force myself to look at code for more than 20 seconds without mentally panicking.
I don't know how I got here. I think it's a combination of many things, such as 1) a demanding family life 2) web development getting more complex in general 3) more stressful work environment 4) physical discomfort like RSI getting worse 5) just getting older & brain getting foggier.
I don't think learning in my off hours is an option because my day job is so mentally draining. It takes all of my brainpower just to work from 9 to 5, and then I have nothing left over after that.
I am talking to my manager about reducing my responsibilities but really I've been feeling this way for over a year, just trying to hang in there. But it's only getting worse as the months go by.
You could also go into areas that are less code intensive. So what I mean is for example ETL where you often use visual tools to develop data integrations. It's still engineering but more approachable or less complex. Same with Business Intelligence where you maybe develop reports (also tool based).