Search code examples
javascriptnode.jsdebuggingbreakpoints

What if I forgot to remove 'debugger;' in a .js file & deploy it on live. Will it affect my application?


I'm working on a nodeJs application & by mistake I forgot to remove the debugger; code in it. Will I face any issues if I deploy the same code on live ?


Solution

  • debugger statements will affect Node application only if debugging mode was enabled, with --inspect option or other ways listed in the documentation. Otherwise they will be ignored; their performance impact is minimal.

    A possible way to avoid this situation in future is to enable ESLint no-debugger rule and enforce it on deployment.