I don’t think either should matter, you’re paid for a job function not the tools you use, but the latter is a trap on my opinion.
I’m turning 40 this year and as such an approaching the sort of midway of my career and in my anecdotal experience you’re never paid for the tech stack. I’ve worked in startups, enterprise and startups growing into enterprises with lucrative employee stock options. I’ve worked with everything dotnet, Python, C++, RPA-tooling, Java, COBOL, SharePoint and SAP, JavaScript and now TypeScript. I’ve worked with every sort of operations setup from in-house to cloud and I very where in between. I’ve worked as a developer, then project/actual manager then enterprise architect and now developer again.
The only things that I have done that had any real impact on my pay grade level was changing jobs and doing indirect negotiations. You need to deliver solutions, you need to show the business the impact of those solutions and you need to make sure your employers know that they aren’t the only company in town who knows about the business value you being to the table.
I also encourage sharing your pay information with your peers. I’ve been fortunate enough to land some nice contracts, but because I’ve shared info with my peers I know of at least two people who went to the negotiation table where they managed to get the company to at least match my pay.
But tech stack? As long as it’s a sellers market, I’d encourage you to get good with something that is in demand that you also happen to enjoy working with. For me that is currently TypeScript front ends with node/dotnet backends that run in azure functions.