An error messoge should come from the runtime environment or VM. It should always be as close to the source of the problem as possible. If a transpiler becomes the middleman for error messages you can never be sure what the original message was and you might misinterpret it. That’s like your friend saying that he was told there was free lunch at the restaurant. Let’s ignore TANSTAAFL for the sake of the example, but shouldn’t you rather call the restaurant itself to find out if it’s really true before you show for dinner?
That’s the way transpilers act on error messages: they go „Dude, I’ve was told the runtime engine there was an error. I think it might have looked like this. I’m not really sure, where it happened. You know, maybe it was even me, who caused it. Who knows!?“.
The worst part: some of the generated Code gets really bloated. All that talk about callback hell has led to the belief that this was the only hell to fear. But there’s also transpiler hell, where heaven was promised.
A superficially simple async in Babel gets transpiled to a generator function and then needs get transpiled again (regenerated) just to run on a quite recent Internet Explorer version. The generated code is full of wrapper and helper trash.
I’d rather have a few clean callbacks than this kind of bloat. It’s almost undebuggable.