sql.js doesn't work

Using sql.js (https://github.com/kripken/sql.js), node works fine with it:

$ grep sql.js package.json
    "sql.js": "^0.2.21",


$ cat go.js
require('sql.js');
console.log('done');


$ node go.js
done

And it similarly runs fine from IntelliJ when I simply choose Run go.js.  But when I choose Debug go.js, I just see:

/Users/yang/.node/wab-4.1.0/bin/node --debug-brk=63306 --nolazy go.js
Debugger listening on port 63306


And nothing happens.  When I click Pause Program, I see the attached stack.

Even when I run under the node debugger, it's fine:

$ node debug !$
node debug ./go.js
< Debugger listening on port 5858
debug> . ok
break in go.js:1
> 1 require('sql.js');
  2 console.log('done');
  3
debug> c
< done



Same thing with node-inspector.


I'm using the latest sql.js version 0.2.21 on node 4.1.0.


Any ideas?


Attachment(s):
Screen Shot 2015-09-22 at 11.54.43 PM.png
4 comments
Comment actions Permalink

Works fine for me when using Node 0.10.* and sql.js 0.2.21; must be something specific to Node 4

0
Comment actions Permalink

just checked - works fine when using Node 4.1.1 as well.
BTW, screenshot just shows that WebStorm is paused on breakpoint. What happens when you press Resume?

0
Comment actions Permalink

It's paused there because I pressed Pause Program.  If I press Resume, nothing will happen and it won't be pause-able again, only killable.  [See my later reply for an update.]

I'll try out in a new env/project using 4.1.1.

Message was edited by: Yang Zhang

0
Comment actions Permalink

It turns out, this problem occurs only if I enable JavaScript Exception Breakpoints (even Uncaught Only).  It goes away if I turn that off.  So you may also see it if you turn that on.

Exception Breakpoints are important to me so I try to leave it on—it would be a major hassle to toggle it on and off every time I restart my program just so it can make it past the sql.js loading.

It's just bizarre since the IDE doesn't actually break into the debugger at any point—it just strangley hangs there, not like it's actually hitting any breakpoint.  And when I press pause (which does drop me into the debugger where I can see the stack trace etc.) and then press resume, the program just continues on its way like normal past that tarpit.  (Disregard my other response where I said it does something else on resume.)

For good measure, I tried also toggling the Suspend option on and off, but no difference.  This also happens regardless of whether I'm using node 4.1.0 or 4.1.1.

Any ideas on what can be done about this?

0

Please sign in to leave a comment.