This question was asked on Hacker News last week.
My favorite answer:
I’ve been freelancing for 7 years, and the market has never been better for reliable web developers. A knowledgeable full-stack dev can earn above SV-level salary as a remote freelancer.
However, if you’re marketing yourself purely as a “web developer”, you’re already commoditizing your skills. Instead, become an expert in a specific type of business/client and sell your ability to solve problems in that business domain. Your clients should not care about the tech you’re using. You need to instead be seen as the expert who solves their problems with tech.
If you go this route, not only is freelancing viable – I think it’s the best way to maximize your earnings as a developer.
(Note the similarity between this advice and that of the SEO for lawyers guy earlier.)