Theseus and sails.js

193 views
Skip to first unread message

Glauber Silva

unread,
Oct 14, 2013, 9:41:55 AM10/14/13
to theseus...@googlegroups.com
Can I debug a sails.js app whith Theseus? I tryed "node-theseus app.js" command and it shows the message "[node-theseus] notice: node-theseus cannot instrument forked processes yet".

Tom Lieber

unread,
Oct 14, 2013, 11:22:12 AM10/14/13
to Glauber Silva, theseus...@googlegroups.com
It depends on whether you want to debug your app itself or the the stuff that grunt does in the background (from the looks of it, stuff like transforming CoffeeScript files to JS).

If you run node-theseus with the --theseus-verbose flag, you can see all the files that will be debuggable with Theseus if you launch it like you did:

$ node-theseus --theseus-verbose app.js
[node-theseus] adding require() instrumentation hook
[node-theseus] listening for WebSocket connections on port 8888
[node-theseus] instrumenting /Users/tom/tmp/testProject/app.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/400.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/403.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/404.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/500.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/adapters.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/bootstrap.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/controllers.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/cors.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/csrf.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/i18n.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/local.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/log.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/policies.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/routes.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/session.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/sockets.js ...
[node-theseus] instrumenting /Users/tom/tmp/testProject/config/views.js ...
[node-theseus] notice: node-theseus cannot instrument forked processes yet---child_process.fork called with arguments: { '0': '/Users/tom/tmp/testProject/node_modules/sails/lib/grunt/../../node_modules/grunt-cli/bin/grunt',
  '1': 
   [ 'default',
     '--gdsrc=/Users/tom/tmp/testProject/node_modules/sails/lib/grunt/../../node_modules',
     '--environment=development',
     '--baseurl=http://localhost:1337',
     '--signalpath=/___signal' ],
  '2': { silent: true, stdio: 'pipe' } }
[node-theseus] instrumenting /Users/tom/tmp/testProject/api/policies/isAuthenticated.js ...

If it turns out you're interested in debugging the grunt stuff, you might want to tweak Sails.js to launch node-theseus with grunt as an argument rather than launching grunt directly, though I haven't tried that and there may be further complications.

By the way, based on my experience playing with Sails.js for all of 5 minutes, I just pushed node-theseus 0.2.2:
- if process.exit is called 3 times, then actually exit
- show the arguments passed to child_process.spawn and child_process.fork when --theseus-verbose is given

Have fun!


On Mon, Oct 14, 2013 at 2:41 PM, Glauber Silva <gla...@gmail.com> wrote:
Can I debug a sails.js app whith Theseus? I tryed "node-theseus app.js" command and it shows the message "[node-theseus] notice: node-theseus cannot instrument forked processes yet".

--
You received this message because you are subscribed to the Google Groups "Theseus Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theseus-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/
Reply all
Reply to author
Forward
0 new messages