Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clasp commands return offline error 90% of the time #872

Closed
lacarmen opened this issue Aug 24, 2021 · 10 comments · Fixed by #936
Closed

Clasp commands return offline error 90% of the time #872

lacarmen opened this issue Aug 24, 2021 · 10 comments · Fixed by #936

Comments

@lacarmen
Copy link

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)
@FGtatsuro
Copy link

FGtatsuro commented Aug 28, 2021

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

@bryankennedy
Copy link

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?

@ryotatake
Copy link

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 ...

@lacarmen
Copy link
Author

Downgrading Node to 14.17.5 worked for me as well.

@shuhankuang
Copy link

shuhankuang commented Dec 31, 2021

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

@dsuzuki
Copy link

dsuzuki commented May 27, 2022

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

@jvanalst
Copy link

For those looking for a quick way to downgrade clasp:

npm install -g @google/clasp@2.3.1

@grant
Copy link
Contributor

grant commented Sep 1, 2022

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

clasp/src/utils.ts

Lines 220 to 226 in e851215

export const checkIfOnlineOrDie = async () => {
if (await safeIsOnline()) {
return true;
}
throw new ClaspError(ERROR.OFFLINE);
};

@grant grant mentioned this issue Sep 1, 2022
3 tasks
@RealSlimMahdi
Copy link

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

@mc-ct
Copy link

mc-ct commented Sep 23, 2022

@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: #937

@sqrrrl Could you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants