Error of "SyntaxError: Unexpected token '.'" when Using Option Chaining Syntax in Extensibility Code

Problem statement

When using option chaining syntax in extensibility code such as in an action, the following error occurs:

SyntaxError: Unexpected token ‘.’

Cause

This occurred in a Tenant configured to use an older version (<15) of Node.

Solution

Option chaining is only supported in Node versions 15 and above. To resolve this issue, verify the tenant is using a newer version (>=15) of Node and that the action is also set to use the newer runtime as well.