2014-10-07 163 views
0

我在IDEA上设置node-webkit,并发现调试问题 - 断点不起作用。IntelliJ IDEA Node-Webkit调试不起作用

这里是我的代码:

的index.html

<!DOCTYPE html> 
<html> 
<body onload="process.mainModule.exports.callback0()"> 
<script> 
    var sup = require('./sup.js') 
    document.write(sup.hi()) 
</script> 
</body> 
</html> 

的package.json

{ 
    "main": "index.html", 
    "name": "Test", 
    "version": "0.0.0", 
    "node-main": "node-main.js" 
} 

sup.js

module.exports = { 
    hi: function() { 
     return 'hi'; //breakpoint here don't work 
    } 
} 

节点main.js

var i = 0; 
exports.callback0 = function() { 
    console.log(i + ": " + window.location); //breakpoint here don't work 
} 

控制台输出

0: file:///C:/%5CWork%5Cwebkit%5Cwebkitbase/index.html 

HTML输出

这意味着在IDEA调试中执行和问题的所有脚本。可能是什么原因?

回答

0

看起来像IDEA中的错误。

选中IDEA 13.1.5和WebStorm 8.0.4。

都有这个问题。

还有一些在IDEA/WebStorm的又原始节点的WebKit支持许多其他sympthoms:

1)debugger声明的作品,但只有在SUP模块(未在节点主脚本作品)。

2)index.html调试工作,但行号不匹配。

3)步入从index.html的作品sup.js但它需要某种生成的代码看起来像:

(function (exports, require, module, __filename, __dirname) { 
    module.exports = { 
     hi: function() { 
      return 'hi' 
     } 
    } 
}); 

有关于这个问题的IDEA/WebStorm错误追踪某些活动,但看着根据其强度,可以等待几个月,然后再考虑严重使用IDEA node-webkit集成。