Tech is an ecosystem, you can make just as much money off dead trees as you can off of killing wild boars. Coders who can work on both legacy and brand-new applications are the most versatile. If you think your skills are being neglected just because you're on Rails instead of Node or Elixir, or CoffeeScript instead of ES7, you've got a hard career ahead of you.
The lesson isn't to migrate every year to the new hotness, it's to pick proven tech that is going to still exist in ten years. The Lindy effect applies.
Fewer technologies, with better support and bigger communities, are better than a fragmented ecosystem.
Fringe technologies come and go. The only reason to bet on a fringe technology is if you see major advantages, and in that case it is unlikely to remain fringe. Once it has been around for a few years and adoption is flat or dropping, yes, it is time to move on. That's just the cost of making a bad bet.
The number of technologies you can learn in your career and really master is limited. Too many people forget that.