Closed dgoldstein0 closed 7 years ago
The sourcemap generation code has been refactored since this issue was posted. If there is still an issue in the current 2
-branch compiler, please update this issue or open a new one.
I worked around the issue a long time ago by resolving paths before I fed them to coffee. Given that, and that I'm using code 1.10 still, and that I'm ditching coffee in favor of typescript, I'm not going to bother testing if it's fixed or not.
On Wed, Apr 26, 2017, 7:23 PM Geoffrey Booth notifications@github.com wrote:
The sourcemap generation code has been refactored since this issue was posted. If there is still an issue in the current 2-branch compiler, please update this issue or open a new one.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jashkenas/coffeescript/issues/4250#issuecomment-297593342, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBnd-8wltlfQ1VSuFKfAvdZdcaZkhxAks5rz_wtgaJpZM4IFE73 .
Spent a few hours today tracking this down... right now I'm planning to work around this by resolving to real paths before constructing my coffeescript compile command, but I figured I should document the bug in hopes that maybe it'll help someone or eventually get fixed.
I set up the following directory structure:
static
, which itself containsjavascript/compiled
andcoffee
folderscoffee
, and get compiled intojavascript/compiled
. This example usesasdf.coffee
as the only source. (all that matters is that it's valid coffeescript.)now the command
Generates the following (correct) sourcemap:
Whereas the alternate command - which only differs by using the symlinked locations:
produces the sourcemap
It would appear that
coffee
is somehow resolving symlinks in the--output
argument, without doing the same for the input file paths. This is a problem because neithera
ordontserve
do not appear on my webserver - the root path containsstatic
.My only workaround for the moment is to resolve paths with symlinks in them to their canonical paths before invoking
coffee
. Requiring this seems fragile though.