Execution of console.info fails in Blockly script

I am trying to understand why I am getting the following error in my logs:

2024-04-15 00:54:51.126 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'Kitchen_motion': Failed to execute action: 4(null)

Here is the code for action 4 that fails:

actions:
  - inputs: {}
    id: "2"
    label: Update kitchen counter presence
    description: Update dummy presence item
    configuration:
      itemName: KitchenCounterPresence
      state: ON
    type: core.ItemStateUpdateAction
  - inputs: {}
    id: "4"
    label: send a log message (w Blockly)
    configuration:
      blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
        type="oh_log" id="5S;/bLIO+6nQU/)3]Tv$" x="260" y="162"><field
        name="severity">info</field><value name="message"><shadow type="text"
        id="ZP/|T$!=JK6/B5AHxG[Y"><field name="TEXT">abc</field></shadow><block
        type="text_join" id="VEOl.NW/_=Rd3Vyt{t`E"><mutation
        items="2"></mutation><value name="ADD0"><block type="text"
        id="mSjb%m]IDES9V*ra=YUl"><field name="TEXT">Kitchen Counter occupancy
        updated to ON, triggered by </field></block></value><value
        name="ADD1"><block type="oh_context_info"
        id="Z:vm-DP)e]}Y850P#O[b"><mutation asType="null"
        contextInfo="itemName"></mutation><field
        name="contextInfo">itemName</field></block></value></block></value></block></xml>
      type: application/javascript
      script: >
        console.info(('Kitchen Counter occupancy updated to ON, triggered by ' +
        String(event.itemName)));
    type: script.ScriptAction

Why does this simple action fail?

Did you install JavaScript Scripting? (i.e. JavaScript/ECMAScript 262 Edition 11)

I think he must have. He wouldn’t have the option to create a Blockly script otherwise. The mime type of the action looks right too.

@tophee, I don’t see anything obviously wrong with the code. How was the rule triggered? event doesn’t always exist and event.itemName only exists when the rule is triggered by an Item event. I would expect an error if the rule was triggered some other way (e.g. time trigger, run manually, etc.).

This is what I have: