Clasp: weird "clasp version" behaviour

Created on 8 Apr 2020  Â·  14Comments  Â·  Source: google/clasp

I'm working on a Google Sheets Add-on. I'm running

  • clasp deploy && clasp version "message"
  • then I update the version number of my deployed add-on

Expected Behavior

everything should work

Actual Behavior

I'm getting We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED. in the JS console when running the plugin

Steps to Reproduce the Problem

see above

What makes me think this is a clasp issue is that if I run clasp deploy and then create the version manually in the UI everything works fine.

Specifications

  • Node version (node -v): v12.12.0
  • Version (clasp -v): 2.3.0
  • OS (Mac/Linux/Windows): Mac

Most helpful comment

Ah ok, that makes sense - thanks for the offer of help. Let me describe the issue as I see it - we can then work out if I can make a PR. I am not sure right now what the PR would be.

Here's the issue:
Step 1. I do

clasp version "some version name"

This gives me a new version (say version 5).

2. I then go the google apps script, and use "File > Manager versions". I this, I see a new version (number 5) with "some version name" as expected.

3. Publish the add-on (i.e., I change the version number of the script to 5, and update and publish)

Result. The published version doesn't show the add-on menu (see above).

4. I then go back to the google apps script, and use "File > Manage versions". I this, I add a new version (6) with "another version name".

5. Publish the add-on (i.e., I change the version number of the script to 6, and update and publish)

Result. The published version now shows add-on menu as expected.

This would seem to indicate that somehow the effect clasp version is somehow different from using the GUI (FIle > manage versions). While clasp version produces a new version, this new version is not recognised in the publishing process.

Does that help?

All 14 comments

@lukas1994 When you say "and then create the version manually in the UI everything works fine." I think you've just solved a problem preventing me from publishing for more days that I'd like to admit.

I say that because for me, "latest code" always works, despite being identical to the version I've pushed from clasp-deploy. (confirmed by writing the commit hash in to a html element in my ui).

Yeah I still haven't figured it out. clasp version must create a different version than when I create it using the UI.

Hello! I've just had likely the same problem, driving me round the bend (Node v10.19.0, clasp 2.3.0, Ubuntu 20.04).

I use clasp push && clasp version to update the version, and then manually update the marketplace listing. The add-on menu doesn't show any of the menu items, but only 'help'.

When I do clasp push, but manually increment the version number using the script editor, then update the marketplace listing, the add-on works as intended.

For those wanting a quick workaround for this, after you deploy a version from clasp that is broken:

Do "File", "Manage versions", type up a new name and save.

This takes your clasp deployed version which has something baked in to it that breaks it which when copied is missing, in the same way that latest code isn't broken despite seemingly being a copy.

We're hoping this means we can select that version to publish, will update when we know.

You don’t need to use clasp version at all in your workaround.

On Thu, Apr 30 2020 at 10:48 AM, dan < [email protected] > wrote:

For those wanting a quick workaround for this, after you deploy a version
from clasp that is broken:

Do "File", "Manage versions", type up a new name and save.

This takes your clasp deployed version which has something baked in to it
that breaks it which when copied is missing, in the same way that latest
code isn't broken despite seemingly being a copy.

We're hoping this means we can select that version to publish, will update
when we know.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
https://github.com/google/clasp/issues/761#issuecomment-621730079 ) , or unsubscribe
(
https://github.com/notifications/unsubscribe-auth/ABUVAAUJFXTHUNLHV2ERB6DRPFCNNANCNFSM4MEGZH4A
).

@lukas1994 Thanks for investigating - much appreciated!

It would be amazing to get a fix for this - just saying, hoping that one of the devs has something in store! :)

If one can PR a test case for this issue, then I'll investigate along with #778

@PopGoesTheWza - I'm not sure what that means? I assume it's aimed at the repo owners, right?

@bjohas I am apparently the only active maintainer at the moment. Since I am not much experienced with the use of version and add-ons, if anyone contributes a Pull Request with a test case which reproduce the issue, I can look into it.

Ah ok, that makes sense - thanks for the offer of help. Let me describe the issue as I see it - we can then work out if I can make a PR. I am not sure right now what the PR would be.

Here's the issue:
Step 1. I do

clasp version "some version name"

This gives me a new version (say version 5).

2. I then go the google apps script, and use "File > Manager versions". I this, I see a new version (number 5) with "some version name" as expected.

3. Publish the add-on (i.e., I change the version number of the script to 5, and update and publish)

Result. The published version doesn't show the add-on menu (see above).

4. I then go back to the google apps script, and use "File > Manage versions". I this, I add a new version (6) with "another version name".

5. Publish the add-on (i.e., I change the version number of the script to 6, and update and publish)

Result. The published version now shows add-on menu as expected.

This would seem to indicate that somehow the effect clasp version is somehow different from using the GUI (FIle > manage versions). While clasp version produces a new version, this new version is not recognised in the publishing process.

Does that help?

@bjohas @PopGoesTheWza

Result. The published version doesn't show the add-on menu (see above).

I can reproduce this step by step.

@PopGoesTheWza I can provide an access to my add-on / project for you.

The related topic on the issue tracker https://issuetracker.google.com/issues/152070295

@lukas1994

Whatever solution you mentioned here and on the original issue (https://github.com/enuchi/React-Google-Apps-Script/issues/29) did not work for me.

Steps:

  1. I compiled the project with webpack (Using React) and pushed it to clasp clasp push
  2. Then I do deploy the new version and it created a new version (say 210) clasp deploy -d
  3. Now I go to UI File -> Manage Versions -> Save new version (say 211)
  4. Update the listing of the app to 211

Which didn't work. Any idea?

Specs: (Using Github actions)
Node: 10.x
Clasp: latest

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smandava picture smandava  Â·  8Comments

coccoinomane picture coccoinomane  Â·  5Comments

labnol picture labnol  Â·  4Comments

PopGoesTheWza picture PopGoesTheWza  Â·  4Comments

grant picture grant  Â·  4Comments