Decode a rhinocompute object in javascript

Hi,

In javascript i tried to decode a rhinocompute object but failed with the following script.

// Import libraries

import rhino3dm from 'rhino3dm'
import { RhinoCompute } from 'rhinocompute'


// Load rhino3dm
const rhino = await rhino3dm()
console.log('Loaded rhino3dm.')

// Your code ...
RhinoCompute.url = "http://localhost:5000/"
RhinoCompute.apiKey = ""

const c1 = new rhino.Circle([0,0,0],10)
const c2 = new rhino.Circle([5,0,0],10)

const ca = RhinoCompute.Curve.createBooleanUnion([c1.toNurbsCurve(),c2.toNurbsCurve()])

rhino3dm().then((rh) => {
    const x = rh.CommonObject.decode(ca)
    console.log(x)
})

Error

the object from rhinocompute before the decoding looks like this.

Any help is welcome.

Is ca an array? If so, you might need to try decoding ca[0]

Thanks @stevebaer ,

yes it is an array , now i got the encoded data and another error :sweat_smile: .

This is confusing to me , is this promise function not fullfilled and “data“ in this object is empty or what is - e is undefined .

I am confused , i thought i call .then() to run a function after the promise function is fullfilled.

To much Unknown when connecting all these technologies :exploding_head: