2016-11-15 12 views
0

私は反応ネイティブをデバッグするためにクロムを使用しています。 私はタブをデバッグ「ソース」の下に「キャッチ例外で一時停止」を選択すると、次の例外が常に発生します。例外が発生したTypeError: freeProcess.binding is not a functionネイティブのデバッグの例外に反応します

ファイル:

http://localhost:8081/<Project_folder>/node_modules/react-proxy/node_modules/lodash/_nodeUtil.js

を例外はラインであります18:それの.jsページの return freeProcess && freeProcess.binding('util');

全コード:

var freeGlobal = require('./_freeGlobal'); 

/** Detect free variable `exports`. */ 
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; 

/** Detect free variable `module`. */ 
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; 

/** Detect the popular CommonJS extension `module.exports`. */ 
var moduleExports = freeModule && freeModule.exports === freeExports; 

/** Detect free variable `process` from Node.js. */ 
var freeProcess = moduleExports && freeGlobal.process; 

/** Used to access faster Node.js helpers. */ 
var nodeUtil = (function() { 
    try { 
    return freeProcess && freeProcess.binding('util'); 
    } catch (e) {} 
}()); 

module.exports = nodeUtil; 

この例外を避ける最もエレガントな方法は何ですか?

ありがとうございます!

+0

これは構文エラーになります。 'Stop Remote JS Debugging'と' Reload'を試してみてください。 –

+0

私は理解できませんでしたが、どうすれば構文エラーになりますか?私はこのコードを書かなかった、それはライブラリに組み込まれている... 私はリモートjsのデバッグと再ロードを停止しようとしました - これを解決しません。 node.jsと何か関係があると思いますが、node.jsは使用しません –

答えて

0

私は一時的に解決しました。

私は、ライン18を変更した:このファイルに

return freeProcess && (typeof freeProcess.binding === "function") && freeProcess.binding('util'); 

/<Project_folder>/node_modules/react-proxy/node_modules/lodash/_nodeUtil.js 

それは、ライブラリのgitの中に固定されなければならないので、このソリューションは、最高ではありません。私はライブラリがロダッシュだと思うが、そのgitファイルを見つけることができなかった - https://github.com/lodash/lodash

関連する問題