importしたライブラリをconsoleから呼び出してデバックする方法 [JavaScript]

debuggerを仕込んだ後に、Dev Toolで axios を呼ぶと エラーメッセージ「Uncaught ReferenceError: axios is not defined」が出力される。

import axios from 'axios';

function ApiRequest() {
  debugger;
}

これは、変数 dubug_axios に axiosを代入し、dubug_axios を呼び出すことで解決できる。

import axios from 'axios';

function ApiRequest() {
  const dubug_axios = axios;
  debugger;
}

参考文献

ES6 module import is not defined during debugger