clasp: Avoiding Ctrl+c exits to every call

Expected Behavior

Running any call (e.g. clasp push) should push to the server, then exit, returning to the normal terminal prompt.

Actual Behavior

Running any call (e.g. clasp push) pushes correctly to the server, but the terminal remains unresolved, or unclosed properly. It is responsive, but will not return to the normal terminal prompt without forcefully exiting with Ctrl+c.

Steps to Reproduce the Problem

  1. clasp push
  2. Hangs until Ctrl-c input

Specifications

  • Node version (node -v): 14.9.0
  • Version (clasp -v): 2.3.0
  • OS (Mac/Linux/Windows): Linux Ubuntu 18.04.4

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 79

Commits related to this issue

Most upvoted comments

Removing all kind of is-online testing would go against the philosophy of original Google designers. Thus I will not rush taking such a route.

Is there a forked version I can try to install?

npm uninstall -g @google/clasp
npm install -g forked-clasp

You should get version 2.9.0 with -W and -X options.

I’ll try to put up a release which address the is-online package issue asap.

@PopGoesTheWza To further confirm that public-ip/is-online is causing the issue I removed the call to isOnline() in here:

https://github.com/google/clasp/blob/4464f73465dd9697ae22fab81c42370ca98232c6/src/utils.ts#L172

and replaced it with true. The issue disappeared immediately.

In the documentation https://github.com/sindresorhus/is-online#how-it-works they mention that is-online tries to determine if the machine is connected to the internet by performing several checks in parallel and it returns true when the first of them returns true.

My guess is that the check performed via captive.apple.com succeeds on my network (given that it uses the proper local DNS) and the others (OpenDNS and myaddr.google.com) are not. The promise isOnline() returns, making clasp progress, but the remaining inner promises are not cancelled and keep dangling until the number of retries/timeout occurs 60/70 seconds later.

@nilp0inter Your output is nearly identical to mine… (macos big sur, immediate exit)

@imthenachoman @nilp0inter you can try https://www.npmjs.com/package/forked-clasp/v/2.8.0

it has the option -W or --why which will log what is still running upon exit.

i.e. clasp version --why

I hear ya. I love how much you can do with it but it has so many one off issues that prevent it from being a full fledged solution platform. I wish Google invested more time/resources on it. Either way, I just wanted to let the devs of clasp know there are numerous other folks raising this particular issue.