How to locally debug Google apps script?

Viewed 1192

I use clasp with VS Code to locally developing of Google Apps Script. It's too hard to use default code debugger. So I'm looking for some way to debug code locally. Any suggestions how can I do this?

2 Answers

The short answer is there is no way to debug it as you would do in the editor.

You can try to make workaround creating testing suites, or introducing various logs. But you cannot go step by step, inspecting variables as you would do normally.

Reference

It's not the best, but I'm inserting

SpreadsheetApp.getUi().prompt(varNeededToCheck);

If it's not the value you are expecting you can cancel the script or you can press OK to continue. It's a workaround and how I'm doing it.

Related