3

Why doesn't google Apps Script support latest javascript features like optional chaining even though it's running on Chrome V8? When optional chaining is used, clasp is throwing an error.

GaxiosError: Syntax error: ParseError: Unexpected token .

The runtime environment is already mentioned in the manifest file appsscript.json as:

{
    ...
    "runtimeVersion": "V8",
    ...
}

1 Answer 1

5

Optional chaining now works.


Currently, this feature(optional chaining) is not supported. A bug report was raised and was denied by Google:

Status: Won't Fix (Infeasible) Hello, Currently this operator does not work on Apps Script. V8 allows you to run modern syntax, but not all of the newly released features. You can check the information in ⁠V8 Runtime Overview To sum up, apps script v8 is not javascript. Regards.

You may however be able to raise a feature request for the same(This is NOT a bug report).

2
  • Is there an eslint setting that matches what the V8 runtime supports?
    – Steve
    Nov 12, 2020 at 21:37
  • 2
    @Steve "ecmaVersion": 6 should satisfy. You could also try 2018 or 2019 instead of 6
    – TheMaster
    Nov 13, 2020 at 4:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.