clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Clasp commands return offline error 90% of the time

Open lacarmen opened this issue 3 years ago • 6 comments

Expected Behavior

No error

Actual Behavior

Almost every time I run a clasp command, I receive this error with one or all of the domains listed

drive.google.com ✖
console.developers.google.com ✖
script.google.com ✖
Error: Looks like you are offline.

Once in a while the command manages to work successfully, but sometimes I have to retry the command 10+ times.

Steps to Reproduce the Problem

  1. run a clasp command, for example clasp push or clasp pull
  2. receive error

Specifications

  • Node version (node -v): 16.7.0
  • Version (clasp -v): 2.4.1
  • OS (Mac/Linux/Windows): macOS Catalina (10.15.7)

lacarmen avatar Aug 24 '21 17:08 lacarmen

I have same issue too.

% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
drive.google.com ✖
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
drive.google.com ✖
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
drive.google.com ✖
script.google.com ✖
Error: Looks like you are offline.
^P
% npx clasp push
drive.google.com ✖
script.google.com ✖
Error: Looks like you are offline.
% npx clasp push
...
Pushed 2 files.
# On OSX 11.5.2
% node --version
v16.5.0
% npx clasp --version
2.4.1

FGtatsuro avatar Aug 28 '21 02:08 FGtatsuro

I was seeing this same error when using node version 16.7.0. However, when I switched back to a LTS version, 14.17.5, I stopped having this issue.

I'm not 100% sure, but could this be specific to the Node 16?

bryankennedy avatar Sep 02 '21 17:09 bryankennedy

I have the same issue when using clasp version 2.4.1. But it works well when downgrading to 2.3.1.

  • Node version: v16.8.0
  • OS: Manjaro Linux (21.1.0)
$ clasp -v
2.3.1

$ clasp login  
Logging in globally...
🔑 Authorize clasp by visiting this url:
...
Authorization successful.

Default credentials saved to: ~\.clasprc.json ...

ryotatake avatar Sep 04 '21 12:09 ryotatake

Downgrading Node to 14.17.5 worked for me as well.

lacarmen avatar Sep 10 '21 16:09 lacarmen

node v14.17.5 clasp 2.4.1 still does not work for me. :(

shuhankuang avatar Dec 31 '21 06:12 shuhankuang

node v16.15.0 clasp 2.3.1 worked for me. So, it seems to be a bug in the clasp. Hope it will be fixed in 2.5

dsuzuki avatar May 27 '22 06:05 dsuzuki

For those looking for a quick way to downgrade clasp:

npm install -g @google/[email protected]

jvanalst avatar Aug 24 '22 16:08 jvanalst

I would remove the feature that checks if you're online on not:

https://github.com/google/clasp/blob/e851215b8abe4de282c62c4d61076c85e89a56ba/src/utils.ts#L220-L226

grant avatar Sep 01 '22 05:09 grant

Any news on that? I am experiencing the issue without any alternative 😢

RealSlimMahdi avatar Sep 21 '22 07:09 RealSlimMahdi

@RealSlimMahdi The combination of node 14.17.5 and clasp 2.4.1 has been working for me.

As for the fix, it seems like we are waiting for this PR to be manually merged: https://github.com/google/clasp/pull/937

@sqrrrl Could you confirm?

mc-ct avatar Sep 23 '22 22:09 mc-ct