labnol / apps-script-starter

Setup a local development environment inside Visual Studio Code and build Google Workspace add-ons with Google Apps Script
https://www.youtube.com/watch?v=KxdCIbeO4Uk
MIT License
1.1k stars 176 forks source link

clasp Push failed. Errors: Project contents must include a manifest file named appsscript. #2

Closed oshliaer closed 6 years ago

oshliaer commented 6 years ago

I'm confused.

npm run deploy is finished with the error:

...
Push failed. Errors:
Project contents must include a manifest file named appsscript.
Files to push were:
└─ dist/code.js
└─ dist/index.html
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! apps-script-starter@1.0.4 deploy: `npm run build && ls -ah ./dist && clasp push`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apps-script-starter@1.0.4 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-08-02T09_56_54_294Z-debug.log

If I run clasp push directly it works fine.

I've checked CopyWebpackPlugin it works fine too.

Also I tracked files in the directory. I'm on Linux

package.json

 "scripts": {
    "deploy_test": "npm run build && ls -ah ./dist && clasp push"
  },

output

...
.  ..  appsscript.json  code.js  index.html
Push failed. Errors:
Project contents must include a manifest file named appsscript.
Files to push were:
└─ dist/code.js
└─ dist/index.html

As can you see the file is there.

Any ideas how to fix this?

oshliaer commented 6 years ago

At now I think the problem in my console because the next script works

package.json

"deploy": "npm run build && ls -ah ./dist && exit 0"

terminal

$ npm run deploy && clasp push
oshliaer commented 6 years ago

Ok. After some tests the next command doesn't work on my system package.json

...
"push": "clasp push",
...

terminal

npm run push

> apps-script-starter@1.0.4 push /home/user/tmp/apps-script-starter
> clasp push

Push failed. Errors:
Project contents must include a manifest file named appsscript.
Files to push were:
└─ dist/code.js
└─ dist/index.html
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! apps-script-starter@1.0.4 push: `clasp push`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apps-script-starter@1.0.4 push script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-08-02T12_16_15_335Z-debug.log
labnol commented 6 years ago

This is an issue with the most recent version of clasp. Switch to clasp 1.4.1 in the package.json and it would work. For some reason, the newer versions of clasp are skipping appscript.json file in the distribution folder.

oshliaer commented 6 years ago

@labnol , it's true. Thanks!

labnol commented 6 years ago

The issue is specific to Google Clasp v1.5.2 though it works with the 1.4 release.

`➜ ls dist appsscript.json code.js
oauth2.js

➜ npx clasp status Not ignored files: └─ dist/code.js └─ dist/oauth2.js

Ignored files: └─ dist/appsscript.json

➜ npx clasp push Push failed. Errors: Project contents must include a manifest file named appsscript. Files to push were: └─ dist/code.js └─ dist/oauth2.js `

labnol commented 6 years ago

@google/clasp 1.5.3 fixes this issue.