run-function --nondev passes the project script ID, but scripts.run requires the API-executable deployment ID
Summary
clasp run-function always passes .clasp.json's project scriptId to
scripts.run. Google documentation and the live Discovery document say this
path field must contain the API-executable deployment ID.
Both modes return NOT_FOUND; the equivalent raw API call succeeds with the
versioned deployment ID and devMode:false.
Reproduction
- Create a container-bound Apps Script with
function claspPing() { return "pong"; }. - Link it to a standard Cloud project.
- Enable the Apps Script API and create a Desktop OAuth client in that project.
- Set
executionApi.accesstoMYSELFand declare the required runtime scope. - Create a versioned API-executable deployment with an
EXECUTION_APIentry point. - Log clasp in with the owner account and the project scopes.
- Run
clasp --user <PROFILE> run claspPingand repeat with--nondev.
Actual behavior
Both commands print:
Script function not found. Please make sure script is deployed as API executable.
The underlying request is:
POST /v1/scripts/<SCRIPT_ID>:run -> 404 Requested entity was not found.
Control
Using the same OAuth token and request body:
<SCRIPT_ID>+devMode:true-> 404<SCRIPT_ID>+devMode:false-> 404<API_EXECUTABLE_DEPLOYMENT_ID>+devMode:false-> 200,"pong"<API_EXECUTABLE_DEPLOYMENT_ID>+devMode:true-> 404
Expected behavior
At minimum, --nondev should call scripts.run with an API-executable deployment
ID and return pong. clasp could accept --deployment-id, select an unambiguous
EXECUTION_API deployment, or fail early with a precise instruction.
The current NOT_FOUND message should not claim the function is missing when the
API rejected the resource identifier.
Environment
@google/clasp: 3.2.0- Node.js:
v26.8.1(Homebrew) - OS: macOS
26.6.2 - Account: consumer Google account; caller is script owner and deployer
References
- https://developers.google.com/apps-script/api/reference/rest/v1/scripts/run
- https://script.googleapis.com/$discovery/rest?version=v1
- https://github.com/google/clasp/blob/v3.2.0/src/core/functions.ts#L73-L92