labnol / apps-script-starter

Setup a local development environment inside Visual Studio Code and build Google Workspace add-ons with Google Apps Script
https://www.youtube.com/watch?v=KxdCIbeO4Uk
MIT License
1.1k stars 176 forks source link

Is there a way to debug the code using an IDE? #49

Closed vdurante closed 2 years ago

vdurante commented 3 years ago

I like the idea of developing my script locally, but it seems that there is no way to debug it, since the google functions are not accessible locally.

labnol commented 2 years ago

You can write a local mock server that simulates the Google Script API calls and can be invoked only when the proces.env. NODE_ENV environment is not production.

labnol commented 2 years ago

See https://github.com/dan-kushnaryov/gas-mock-globals