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

clasp run returns 'No response' when Apps Script function returns 0 #770

Open
joccing opened this issue May 9, 2020 · 3 comments
Open

Comments

@joccing
Copy link

joccing commented May 9, 2020

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

When running an Apps Script function, clasp run should return whatever the function returns.

Actual Behavior

When the function returns a 0, clasp run returns 'No response', and the correct output at other values. To force the 0 to be returned, you need to return the type cast String(output).

Steps to Reproduce the Problem

  1. Create an apps script function

function test() {
return 0;
}

  1. do clasp run test
    No response.

  2. Change to

function test() {
return 1;
}

  1. do clasp run test
    1

  2. Change to

function test() {
return String(0);
}

  1. do clasp run test
    0

Specifications

  • Node version (node -v): 13.8.0
  • Version (clasp -v): 2.3.0
  • OS (Mac): 10.15.4
@joccing
Copy link
Author

joccing commented Jun 3, 2020

Hi Clasp Developer,

May i know if there is a solution to this problem? or is it expected behaviour.

@leeyspaul
Copy link

leeyspaul commented Jul 21, 2020

I'm getting the same error with the production version. When it's a string it returns 0 when it's int it returns No Response.

But when I build with npm run build after uninstalling it globally it returns the correct response (haven't investigated yet).

$ clasp run testStrInt
(node:48234) ExperimentalWarning: The fs.promises API is experimental
Running in dev mode.
0
$ clasp run testInt
(node:48232) ExperimentalWarning: The fs.promises API is experimental
Running in dev mode.
No response.

Node version: v10.10.0
Clasp version: 2.3.0

@atimangel
Copy link

atimangel commented Feb 11, 2023

function that you run is not return anything.
if your function return something it will print on your terminal.
스크린샷 2023-02-12 07 16 14

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