console.log() from node_modules

If you are monkey patching an npm module with a console.log() to debug an issue it should show up just like any other console statement would. It’s probable that your root cause is your build. I’m making some assumptions that you are using babel and a bundler tool like Webpack.

  • Make sure you are doing a full rebuild of your project
  • clear babel cache or try BABEL_DISABLE_CACHE=1 webpack
  • Double check the console.log you are adding isn’t in source code of the dependency therefor is never being called.
  • Try adding a console.log higher up in the file of dependency to better know it’s being loaded at all

Alternatively I’d personally recommend you reconsider your approach. While I’ve actually done this a couple times; if you are adding “debugging” like this to lower level modules you are probably looking in the wrong place for your issue unless there is a legit bug in the lib…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)