Error: Failed to execute 'postMessage' on 'Window'

Hey, I'm currently getting a weird error and I cant find out whats causing it

{"stack":"Error: Failed to execute 'postMessage' on 'Window': function(...t){let n;try{n=e(...t)}catch(e){return}return n instanceof Promise?new Promise((e=>{n.then(e).catch((()=>e()))})):n} could not be cloned.\n at Ac.of [as postMessage] (https://retool-edge.com/runtime.4bc519f0.js:2:768528)\n at Ac.call (https://retool-edge.com/runtime.4bc519f0.js:2:619876)\n at Object.runNetworkQuery (https://retool-edge.com/runtime.4bc519f0.js:2:429042)\n at eval (https://retool-edge.com/runtime.4bc519f0.js:2:337805)\n at Object.withQueryRunContext (https://retool-edge.com/runtime.4bc519f0.js:2:425740)\n at y (https://retool-edge.com/runtime.4bc519f0.js:2:336997)"}

I have a simple javascript query that gets information from selected rows of a table and creates an array of objects for each of the rows.

After doing so, I'm passing it down to a REST-API function which gets called but then leads to this error.

const datesToSync = table_activityDates.selectedRows.map(date => {

const { date_id, activity_id, start, end, ...other fields } = date
  
  return {
      id: date_id,
      start,
      end,
      ... other fields
      group: {
        id: activity_id,
        ... other fields
      }
    }
})

post_classes.trigger({
  additionalScope: {
    datesToSync
  }, 
  onSuccess: function (data) {
    console.log(data)
  },
  onFailure: function (error) {
    console.log(error)
  },
});

The body in the post_classes function looks like this

{
  classes: {{ datesToSync }}
}

Both start and end are strings (as I read in the forum that moment() sometimes makes problems)

Appreciate your help, thanks!

If you send datesToSync to the console (comment out the rest of your code or in a testing block), what does it show? Just thinking to check the input before anything else...