node.js – SyntaxError: Invalid or unexpected token when upgrading to NewRelic version 9

I have a few services which encounter this error after I upgrade the NewRelic agent to version 9+, no such error appears in NewRelic version 8.
One of the services is running on Node 14 the other on 16, both with Typescript 4.9.5.

node_modules/newrelic/lib/config/index.js:1124
  const inputEnabled = inputConfig?.logging?.enabled
                                   ^

SyntaxError: Invalid or unexpected token
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
error Command failed with exit code 1.

Please advise what causes this issue.

Read more here: Source link