14

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

6
  • Have you configured chrome to enable source map? Commented Apr 4, 2013 at 1:43
  • yes. I switched on the enable source map..infact I went and deleted the app.js but still it shows app.coffee but it has .js code in it. Commented Apr 4, 2013 at 1:47
  • This might be related to an issue I raised. Commented Apr 4, 2013 at 8:51
  • were you able to debug the coffee file in chrome . Commented Apr 4, 2013 at 11:31
  • 1
    Are trying to debug a client or a server (node.js) app? Commented Apr 17, 2013 at 15:04

2 Answers 2

2

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).

Sign up to request clarification or add additional context in comments.

10 Comments

I know chrome supports source maps and I am able to do that for coffee script on a webpage. I am talking about the nodejs/express app written in cofffeescript and debugging it. I am pretty sure I am missing something because now that coffeescript is generating source maps ..chrome should be able to pick it as it doing on a web page.
Are you serving map and coffee files? See my last comment.
what do you mean by serving. chrome picks up the js files by itself..so it should pickup the coffee file as well..
You are confusing node-inspector with the Chrome dev tools. They may look similar but node-inspector does not yet support maps - see the first part in my answer.
And now node-inspector supports source maps! github.com/node-inspector/node-inspector/issues/…
|
2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.