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

Google sheets: clasp push command fails #743

Open
jayakrishnankg opened this issue Feb 29, 2020 · 4 comments
Open

Google sheets: clasp push command fails #743

jayakrishnankg opened this issue Feb 29, 2020 · 4 comments

Comments

@jayakrishnankg
Copy link

I am trying to push Google App Scripts code to cloud using the following command:

clasp push

But it fails with the following error.

responseType: 'json', retryConfig: { currentRetryAttempt: 3, retry: 3, httpMethodsToRetry: [Array], noResponseRetries: 2, statusCodesToRetry: [Array] } }, code: 500, errors: [ { message: 'Unknown Error.', domain: 'global', reason: 'backendError' } ]

It works when I push only a few files, so I don't whether it's related to storage limit or any other issue.

I tried adding files directly to google cloud, then I encountered the following error on the last file:

We're sorry, a server error occurred. Please wait a bit and try again.

Please let me know if there is any issue with storage.

Thanks.

@paxperscientiam
Copy link

@jayakrishnankg any luck? Also, how did you get the error message? I'm using v2.3.0 and I'm just seeing "Push failed. Errors:".

@guilhermetod
Copy link

guilhermetod commented Mar 30, 2020

I'm suddenly getting a problem when trying to push too. But I get a differente message:

'Syntax error: Missing name after . operator. line: 29 file: server/main'

I probably already found the problematic line , but it shouldn't requerie a ".".

export { include };
export default { sa, onOpen, everyMonday }; <---- Removing this line solves the problem

I can keep the first line but not the last one. It's a TS project so they get transpiled to

exports.include = include;
exports["default"] = { sa: sa, onOpen: onOpen, everyMonday: everyMonday };

I'm on WSL and it's really odd because it only fails to push if I use zsh or bash on Ubuntu.
Howerver, using either powershell or windows bash successfully pushes the files, but then when I try to run any function it fails with the same message.

@paxperscientiam
Copy link

Unfortunately, I don't recall what the heck i did to get it working again.

@guilhermetod , i'm also doing TS stuff. You might have better luck if you migrate to V8 engine. If you can't do that, you might find that certain variables/functions aren't in the global scope.

For stuff that needs to be globally available even when bundled, there is working polyfill for globalThis:

(function() {
	if (typeof globalThis === 'object') return;
	Object.defineProperty(Object.prototype, '__magic__', {
		get: function() {
			return this;
		},
		configurable: true // This makes it possible to `delete` the getter later.
	});
	__magic__.globalThis = __magic__; // lolwat
	delete Object.prototype.__magic__;
}());

https://mathiasbynens.be/notes/globalthis

@guilhermetod
Copy link

I managed to get it working but I don't recall exactly which moment I got it fully working (push and execution). I can only recall that resetting my locale managed to successfully push the files and it's working on ES5.

@paxperscientiam thanks for the info btw, will try it if I run into this issue again.

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

No branches or pull requests

3 participants