esbuild-coffeescript icon indicating copy to clipboard operation
esbuild-coffeescript copied to clipboard

Transform the location of error messages using source maps

Open STRd6 opened this issue 2 years ago • 1 comments

coffee build/main.coffee 
X [ERROR] Could not resolve "../pixie"

    lib/exports.coffee:3:21: <- !! This should actually be line 1
      3 │ ({version} = require("../pixie"));

The location of error messages comes from the compiled JS, not the CoffeeScript source. It makes jumping to the error slightly annoying.

STRd6 avatar Apr 13 '22 19:04 STRd6

Thanks for your comment! I'll look into it asap 🙏

johnie avatar Apr 18 '22 20:04 johnie

I've just dug into why error locations from esbuild-coffeescript can be wrong, and was surprised to discover that the coffeescript compiler itself is causing this (at least in my case). If I run my example busted coffeescript file through the coffeescript cli, or the Coffeescript 'try' page, I get the same (incorrect) line number and column for the error - which was accurately reported in my esbuild output!

greghuc avatar Mar 14 '23 23:03 greghuc