-
Notifications
You must be signed in to change notification settings - Fork 424
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
"Error: Request contains an invalid argument" on push and deploy #21
Comments
I think you must ignore some files before pushing. i.e. Create a file called I need to write more details on how to ignore files/folders in the README. Link the repo if you can so I can look further. |
The repo is private, so I cannot link it. I created the .claspignore file and the push/deploy simply errors faster now. The error appears to have to do with some google-auth thing no? Any other bug info I can provide? |
The main issue is here:
The google-auth is just the stack trace of the request. This error occurs if there's a bad API request to the Apps Script API. Unfortunately we don't get good reasons for errors from the API. The best way to debug is to remove all files, try pushing, then slowly add each file back in until clasp/the API breaks. I think the API doesn't allow some characters, which may break clasp. Can you remove all files and slowly add them back and push? See which file break it. |
I did as you suggested and traced the issue node_modules folder, specifically a bug in how you guys ignore directories.
Console Output:
Yes, I understand my .claspignore is excessive but I just wanted to try everything. |
Underneath it all we use (Here in clasp: https://github.com/google/clasp/blob/master/index.js#L485) I'll have to look more to see if this is a bug in |
Fixed it. Anymatch uses syntax different from a traditional .gitignore for directories. Related Issue Here. To ignore directories and subdirectories like node_modules the syntax is |
Great! I do need to document How To...Ignore Files... Create a file called |
Looking further, I need to do a better job of ignoring files, I think nested |
If anyone else looks through this thread for the mysterious "Error: Request contains an invalid argument" , the issue that caused me recently to get this same error was that I did not have my .git file entered in the .claspignore file. If you have a .git file in that directory, you'll want to place it in your .claspignore file. |
Another reason is apparently when your |
|
Based off of GitHub analytics, 94 unique people looked at this issue in the last week. Maybe we should provide a better message than the API response: |
@grant I think this issue should be reopened per your suggestion that the error message be made more specific.. For instance, I just deduced the cause of the vague error message in my situation. Steps to reproduce:
Another way:
The above examples produce the error in question, but the error is not produced when the values are switched ( |
Per #21 (comment), I created a basic It looks like this:
It only detects JSON errors like a trailing comma. |
Going to close this issue unless there's something else specific I can do. |
Sorry @grant , but it looks like your error message has been replaced with the wrong error message. When trying to push with a malformed |
Expected Behavior
Push code to script project
Actual Behavior
Request fails on
clasp push
and onclasp redeploy
. Redeploy has a more verbose error report:The auth library fails, so i tried logging back in and out and into another account to no avail
Steps to Reproduce the Problem
With src and build as directories. The main apps script in my project is called
build/Main.gs
and should be pushed from the build directory.2. My build system is currently just using babel to transpile syntax and perform a simple bundle of the
src
directory.Besides that, I don't know what's out of the ordinary with my project. My Google account is personal, not organizational, so the auth issues don't come from that....
Specifications
node -v
): v9.3.0npm list | grep clasp
): @google/clasp@1.0.7The text was updated successfully, but these errors were encountered: