Debugging Iced Coffee Script with Node-Inspector

304 views
Skip to first unread message

chris....@gmail.com

unread,
Oct 15, 2013, 10:20:05 PM10/15/13
to mimo...@googlegroups.com
I've been attempting to debug a server side project built with mimosa and iced coffee script. I've been experimenting with how to debug the ICS files and I'm not having any luck. This seems to be especially important with ICS as the JS it creates is not really human readable.

Used the standard iced REPL its possible to debug an iced coffee script file with the following command:

iced --nodejs --debug server.iced

This seems to generate the source maps which node-inspector picks up correctly (see this image for an example). http://cl.ly/image/2i2k132w1n3H


I'd like to be able to something similar when launching via mimosa. I've tried two basic strategies:


1) Sending a debug signal to the node app which (configured to use express) Mimosa is running.


2) Launching the mimosa app in debug mode based on this discussion ()

In both cases the server.iced has already been transpiled into pure JS. Basically I'm hoping to be able to debug a node js app written in ICS and run via Mimosa.

Any suggestions?


dbashford

unread,
Oct 15, 2013, 10:31:22 PM10/15/13
to mimo...@googlegroups.com, chris....@gmail.com
I've not used node-inspector, but there are a few threads on this board where people have tried and I think were met with some success.

One thing you can do is use mimosa-web-package to create a version of your application that doesn't need Mimosa to run.  If you add mimosa-web-package and run "mimosa build -omp" you'll get a "dist" folder.  Inside that folder will be an "app.js" that you can start using your "iced --nodejs --debug app.js" which I hope would help you.  If that still leave you with already transpiled code, you could try tinkering with app.js, possibly removing the require to iced-coffee-script. 

You could also take the config.js and the app.js and move them into the root of your folder for ongoing debugging if its not a one time thing.

one.las...@gmail.com

unread,
Mar 27, 2014, 10:08:49 PM3/27/14
to mimo...@googlegroups.com, chris....@gmail.com
> iced --nodejs --debug server.iced

This is brilliant. I had no idea you could do this! And I also had no idea that you could start from a .js file like app.js or worker.js, as dbashford suggested. That makes my life so much easier. I love iced but I don't what to debug its transpiled code.

one.las...@gmail.com

unread,
Mar 27, 2014, 10:12:37 PM3/27/14
to mimo...@googlegroups.com, chris....@gmail.com, one.las...@gmail.com
On Thursday, March 27, 2014 7:08:49 PM UTC-7, one.las...@gmail.com wrote:
> > iced --nodejs --debug server.iced
>
> This is brilliant. I had no idea you could do this! And I also had no idea that you could start from a .js file like app.js or worker.js, as dbashford suggested. That makes my life so much easier. I love iced but I don't what to debug its transpiled code.

Okay, honeymoon over. I tried this and I don't get source maps. :(

kenc...@gmail.com

unread,
May 12, 2014, 11:22:00 AM5/12/14
to mimo...@googlegroups.com, chris....@gmail.com, one.las...@gmail.com

Were you ever able to get iced source maps working?

I tried David's suggestion about for the mimosa-web-package and was able to get node-inspector working with "node-debug app.js", but not with "iced --nodejs --debug app.js" and not with "iced --nodejs --debug server.iced" either.

With the node-debug version, node-inspector loaded and worked, but I only saw javascript, not the iced coffee-script code.

Anyone know how the source maps actually work? Are there files somewhere, because if so, I can't find them.

Reply all
Reply to author
Forward
0 new messages