Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

coffeescript sourcemap not loading in chrome

I am able to compile coffee file to .map file in the same directory as the .coffee/.js file when I call

coffee --nodejs --debug-brk app.coffee

and start the node-inspector. The js version of the app file gets loaded in chrome. what am i missing??

this is what chrome is showing for three.coffee file ..

(function (exports, require, module, __filename, __dirname) { // Generated by CoffeeScript 1.6.2
(function() {
  app.get('/three', function(req, res) {
    debugger;    return res.send('three/teedde');
  });

}).call(this);

/*
//@ sourceMappingURL=three.map
*/

});

thanks

like image 931
coool Avatar asked Apr 04 '13 01:04

coool


2 Answers

You are you asking about node-inspector since you say you are starting it? Your question appears as if you are asking about the Chrome dev tools. Please clarify.

The current version of node-inspector in npm (0.2.0beta4) does not support source maps.

Even though the issue has been closed, I have been unable to find anything on github that would enable this feature (e.g. see https://github.com/dannycoates/node-inspector/blob/update-ui/lib/session2.js#L123-L131, there is no sourceMapURL parameter for the scriptParsed event).

node-inspector was taken over by a new developer and according to a comment (by Vitaliy Lebedev) the latest version does support source maps.


If you are asking about the Chrome dev tools - they support source maps.

try "//@ sourceMappingURL=three.map" on the last line in your js file.

Also make sure that your express app is actually serving the .map and .coffee files required by the debugger (check by entering the url+filename in your browser).

like image 188
laktak Avatar answered Oct 04 '22 17:10

laktak


And now node-inspector supports source maps! github.com/node-inspector/node-inspector/issues/… – Vitaliy Lebedev Nov 8 '13 at 12:46

like image 34
coool Avatar answered Oct 04 '22 15:10

coool