clasp: Clasp push does not update remote code
Please search existing issues before creating a new one.
DON’T DELETE THIS! FILL THESE SECTIONS OUT!
Expected Behavior
Making a change to the code and pushing it remote, it should update after a push
Actual Behavior
Pushing once does not reflect updated code, it needs a second push to be seen.
Steps to Reproduce the Problem
- Make changes to code.js, save
- Run clasp push, confirms push
- Reload script, change is not seen
- Run clasp push, confirms push
- Reload script, change is seen
Specifications
- Node version (
node -v): 11.6.0 - Version (
clasp -v): 2.0.1 - OS (Mac/Linux/Windows): OSX 10.12.6
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 7
- Comments: 24 (3 by maintainers)
Official Google™ solution: alias
clasp pushffstoclasp push && clasp push@erickoledadevrel just tried using clasp but I am unable to push any changes. Is there any update on this issue? It seems like a very serious issue if people can not push changed code?
As @jiro2017 said, I would make sure you aren’t getting any error messages in your CLI. I thought clasp push was not working because my remote editor was not updating (even though the files appeared to have been pushed successfully on my terminal). But when I scrolled up, I saw that I had a syntax error.
I think for me I found the issue after using trying clasp version “YOUR_VERSION_STRING”. I got a console message to enable API access. Once I enabled that I was able to make pushes. It’s funny because I was able to clone and pull just fine.
So this is the Settings URL and then make sure that “Google Apps Script API Access” is on.
Hello there! I had the same problem. I figured out this was because I had an opened tab in my browser pointing to my Apps Script project.
If you also have such a tab, try closing it and pushing the code again.
Hope this helps.
One thing I would advise is to look at the error message you got from your CLI. That can help diagnose the problem. Before you push files you must have logged in using
npm clasp loginand have cloned files from your apps script usingnpm clasp cloneto the root folder of your project. When you push files to Google Apps Script, you ought to see a pushing files message when you’re done. If successful, you should able to see a list of files that are pushed from your directory as well as a message telling you your files have been pushed successfully.To see the changes you must refresh the page of your App Script code.
I had the same problem and I tried all suggestions here, but no success. So I changed the main file extension to “.gs” and clasp push worked.
The steps I used to recreate above are pretty much most of it. I tested it from a new project, creating it through clasp and just adding a single line to the Code.js:
var test = "test";If I make changes locally and push, it takes two attempts for it to be updated on the apps script site’s code. @Cerlancism has the trick above that seemed to work, but I wasn’t able to produce reliable results, sometimes it seemed like the code reverted after publishing it.
It definitely seems like it only started in the last month, and yeah, I’m not sure why there aren’t more reports. I thought it might have been something with my larger project until I started a clean one to test.