Facebook Api Login NodeJS Uncaught Exception



我有一个NW.js应用程序,我需要用户登录他/她的Facebook帐户来分享一些东西。当facebook登录弹出窗口出现时,我的应用程序崩溃,消息显示在主窗口的屏幕上;

Uncaught node.js Error
Error: Cannot find module 'TimeSlice'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at window.require (:4:17)
at https://www.facebook.com/login.php?
...

我检查了facebook登录窗口的控制台,这些node.js错误来自下面的弹出窗口;

Uncaught ReferenceError: __d is not defined KLwacKO4h5u.js:34
Uncaught Error: Cannot find module 'TimeSlice' module.js:338
Uncaught ReferenceError: requireLazy is not defined 
Uncaught Error: Cannot find module 'TimeSlice' module.js:338
Uncaught Error: Cannot find module 'BigPipe' module.js:338
Uncaught TypeError: Cannot read property 'beforePageletArrive' of undefined 
...

我搜索了解决方案,并试图用下面的代码捕获所有node.js异常,但它没有帮助,异常仍然抛出未捕获。(我知道这是错的,但我只是想试试。)

var process = require('process');
if(process) {
    process.on("uncaughtException", function(e) { console.log(e); });
}

我在这里错过了什么?你能告诉我如何解决这个问题吗?我想防止应用程序崩溃时,一些异常发生在外部URL的窗口

也许你错过了这个标志…

——allow-cross-origin-auth-prompt

相关内容

最新更新